Question: I've been told that I am to be a team lead of an upcoming project. I've not ever been team lead before but the responsibilities are what you would typically expect, with revolving door of 3 to 4 other developers through the 8 or 9 months it takes to complete the project.

My problem is this: one of the developers who will no doubt be working on this project will be a problem. He has more experience than me, has called me an idiot several times in the past, and has told me that he has taken this job because he is a natural leader. He has expected to be promoted to a leadership position with every new project (which has not happened to date), and even once told me that I was to report to him, even though the actual team lead was under no such illusion. Moreover, I've both observed and heard from others that he is extremely unprofessional (watches non-work videos at client sites - with no head phones, dresses unprofessionally, comes to work late, makes inappropriate jokes, etc.) He took or attempted to take credit for my work or insights multiple times while I worked with him as a peer. My current team lead told me that she threw out 1/2 of this guy's code once he left her project because the quality was no good. I could go on.

My fear is that this guy will actively work against me, because he will resent having to report to someone that he considers an inferior, especially since I have been given this opportunity before him. I've successfully dealt with this type of personality as a peer or even reporting to managers like this in the past. I've not dealt with, or ever thought about, having to deal with this type of character who is reporting to me. 

My question is: what kind of strategies can I use to effectively and professionally deal with this? Especially now, before it has become a problem, is there any way to cut it off before it gets out of hand etc. If anyone has a similar experience how did they deal with it?

Answer: 
Your behavior will need to be, in this case, **entirely professional**. While team lead, you should refrain from any non-professional conduct involving this person so that they will only see you in an authoritative light. This means no discussions about sports, video games, etc. that are considered casual and will put you on a *peer* level with the others. This can be tough, especially if you've been peers with your new underlings up to this point, but it is *essential* for new leaders that have been thrust into such a position. You will be able to return to these intimate behaviors later, but early on it is important that you differentiate yourself.

Early in the project, you will need to establish your authority. Give very clear and direct *orders* for this person to fulfill, and in such a way that there is no ambiguity about your direction or intent - this person will either submit and all will be fine, or they will balk and you will have an open-and-shut case of insubordination to bring to your superiors as to why this worker is unfit for the position.

There can be ***no*** backing down. The moment you give in, you will have lost all credibility and authority with not only the problem employee, but the rest of the team as well.

**Edit** *(incorporating Kevin's comment)*

**Be sure to keep impeccable documentation**. Its tempting to give orders orally in meetings, but even if you do, you should follow those up with an email (which should be CC'd to relevant parties) or a task in your project management system that enumerates your expectations for that particular task. This is best practice anyway, but it has the side benefit of providing a complete and undeniable paper trail that you have been properly communicating with your underlings.

**Edit** *(due to mass confusion)*

My point about casual discussions (ie: sports, video games, etc.) needs to be taken with a grain of salt. I'm not suggesting that you shut down all non-work interaction with your office mates entirely, nor that you shun them when they try to discuss such things with you. Rather, such interactions need to shift into an appropriate supervisor-employee role, at the very least until your underlings have ***adjusted to you in that particular role***.
most answers i see, i think, focus on the wrong problem.

i can't help but think that the OP is disillusioned, this is only half the story

leadership is hard, i can't help but wonder that if i was in the poster's shoes, the situation never would have evolved to the point that a peer disrespects me

developers don't "report" to the tech lead, they report to managers, "tech lead" (in the sense of the guy who knows the most on a team of 6 devs) doesn't get asigned on healthy team, a healthy team organically self-organizes and people naturally grow into ownership of functionality. that teams often don't self-organize is a culture problem at some bigcos for various off-topic reasons, see jurgen apello's writings (noop.nl) for further reading