Of the more than 152,000 residents who turned out to cast ballots in the fourth largest U.S. city Saturday, 81,652 chose Parker -- some 11,000 votes more than were placed for Locke.
The election battle leading up to Saturday's balloting was marked by fierce campaigning and anti-gay rhetoric.
Parker is a lesbian who has never made a secret or an issue of her sexual orientation. But that orientation became focus of the race after anti-gay activists and conservative religious groups endorsed the 61-year-old Locke and sent out mailers condemning Parker's "homosexual behavior."
Meanwhile, gay and lesbian political organizations nationwide rallied to support the 53-year-old Parker by raising money for her campaign and making calls urging people to vote.
Locke tried to distance himself from the anti-gay attacks while courting conservative voters who could tip the race in his favor.
Although Locke condemned the divisive rhetoric, two of his key supporters contributed money to a conservative political action committee that sent out an anti-gay mailer earlier this month, urging voters not to pick Parker because she was endorsed by the "gay and lesbian political caucus."
Campaign finance reports show Ned Holmes, finance chairman of Locke's campaign, and James Dannenbaum, a member of the campaign's finance committee, each gave $20,000.
Late Saturday, Locke offered his congratulations to Parker and urged the city to move on from its most recent battle.
"Here's what our city needs now: It needs unity. It needs us to come together and heal like we've never healed before, and to move forward under a new administration," he said.
Parker will replace Bill White, who is term-limited after serving six years and is seeking the Democratic nomination for governor.
Several smaller U.S. cities have openly gay mayors, including Portland, Ore., Providence, R.I., and Cambridge, Mass.
Houston, the country's fourth largest city, is predominantly Democratic and about 25 percent black and one-third Hispanic. About 60,000 of its 2.2 million residents identify as gay or lesbian.