Updated

After years of considering how to best get into the phone business, Facebook tapped Taiwanese cell phone maker HTC to build a smartphone that has the social network integrated at the core of its being.

Code-named "Buffy," after the television vampire slayer, the phone is being planned to run on a modified version of Android that Facebook tweaked heavily to deeply integrate its services and support HTML5 as a platform for applications, according to sources familiar with the project.

Facebook only recently chose HTC, after also considering at least one other potential hardware partner -- Korea's Samsung. That means the products themselves are still a ways from hitting the market, potentially as long as 12 to 18 months.

Although it has changed scope and leadership, Buffy has been an ongoing area of concern at the social networking giant for the past two years. These days, the project is led by Facebook chief technology officer Bret Taylor, several sources said.

A spokesman for Facebook declined to comment on Buffy directly.

More On This...

But the spokesman added, "Our mobile strategy is simple. We think every mobile device is better if it is deeply social. We're working across the entire mobile industry -- with operators, hardware manufacturers, OS providers and application developers -- to bring powerful social experiences to more people around the world."

HTC declined to comment.

Mobile is critical to Facebook's future. And moving directly into the phone business, while fraught with challenges, may well be essential for the company.

Facebook says it has 350 million active mobile users and relationships with 475 global mobile operators. Although it is one of the most popular applications on nearly every phone for which it is available, the social network generally plays only a supporting role.

In many cases, Facebook is just an app where people can view their friends' feeds and upload their own photos and status updates. In other cases, Facebook has worked to take things a step further, allowing users to upload photos directly from the picture-taking app or to integrate Facebook contacts with the phone's address book.

But the fight for mobile control is only getting more fierce. Google and Apple run the two major smartphone operating systems, giving Facebook little say over its mobile destiny.

Apple has fought to maintain strict control over payments within its mobile apps, even if those apps run off of Facebook's platform, and it also made Twitter its social partner. Google is increasingly a direct competitor, as it is working to promote and integrate its own social network, Google+, across all its products.

The Buffy project represents a significant shift for Facebook, which has focused much of its mobile work on light collaborations with hardware makers looking to create more socially-oriented phones.

Read lots more on the Facebook phone at AllThingsD.com.