Former U.N. ambassador Andrew Young, a globe-trotting diplomat who came home again, was elected mayor of Atlanta tonight over white state Rep. Sidney Marcus in a bitter runoff that pitted blacks against whites in this bustling southern city long noted for its racial harmony.

With all 187 precincts reporting, Young had 65,014 votes, or 56 percent, to 50,977 votes for Marcus.

Young's immediate tasks are to smooth racial tensions that plagued the final weeks of the campaign and to prove that he can unite the races in this predominantly black city.

Young called the campaign "tough, hard but fair," and promised "to be better friends with Sidney Marcus." He said the campaign has "put a strain on us, but there have been no broken relationships, and there will be none in the future."

Sixty-two percent of the city's 191,000 registered voters turned out, with Young drawing heavily from black neighborhoods and Marcus from white. There was some crossover voting, but not enough for Marcus to score an upset.

Young had counted on a heavy turnout in black neighborhoods for a political rebirth as the second black mayor in the city's history.

To encourage inner-city voters, nervous Young staffers today erected signs on downtown highway ramps leading to black neighborhoods. The signs warned that voters on the city's predominantly white north side had turned out heavily.

Young, 49, a former three-term congressman who graduated to the world stage as U.N. ambassador early in the Carter administration, spent most of his energy trying to persuade voters that he really wanted the job, that he did not consider making garbage trucks run on time a step down from dining with heads of state in far-off lands.

Marcus, 53, is a liberal state legislator who enjoyed biracial support and was anointed by a white business establishment long frustrated by downtown crime and poor relations with the eight-year administration of Mayor Maynard Jackson.

Jackson, the city's first black mayor, was limited by law to two terms.

With the elimination of a popular black candidate who finished third in the Oct. 6 general election, most black leaders pulled behind Young and began taking their best shots at Marcus, a low-key politician who enjoyed a blank check from downtown business leaders.

Blacks supporting Marcus were singled out as traitors to the civil rights movement.

Jackson, one of Young's strongest supporters, lit a fuse in a mid-October speech to black businessmen that labeled many black supporters of Marcus as "shuffling, grinning . . . Negroes."

Marcus launched a bitter counterattack in a Sunday night televised debate, accusing Young of using Jackson to do his dirty work.

"The politics of panic used by Mr. Young shows he's willing to destroy our city by manufacturing racial tensions and distrust rather than lose an election," Marcus said.

Young, a civil rights campaign veteran and a protege of the late Rev. Martin Luther King Jr., denied that he had ever "done anything to racially polarize this city," which enjoys a reputation as the most racially moderate city in the South.

He attacked Marcus for shoddy business practices and tardiness in paying property taxes.

Young had taken 41 percent of the vote in the seven-candidate general election, while Marcus received 39 percent. Both candidates then pitched hard, in a campaign of personalities, for the supporters of Reginald Eaves, a popular black Fulton County commissioner who drew 16 percent in the general election and endorsed Young several weeks later.

The candidates differed little on the issues: beefing up police protection, drawing new business for the city and improving the quality of neighborhoods. Young stressed his African connections as a tool to lure foreign investments, and Marcus his connections in the state legislature.