MONROE, N.C. (AP) — A coin flip Friday decided who would be mayor of a south-central North Carolina city when the two leading candidates were tied after all the ballots were tallied.

Robert Burns and Bob Yanacsek each received 970 votes in the race to become mayor of Monroe. Five names had been on the Nov. 7 ballot. Burns won the coin toss.

At Friday's Union County elections board meeting, Yanacsek and Burns waived their right to seek a recount. State law says the outcomes of tied races are determined by lot.

At the coin toss, Yanacsek called heads but the coin flipped by an election official came up tails, leading to celebration from Burns' supporters. The two men shook hands and hugged briefly. The board then voted to declare Burns the winner.

Burns will succeed Marion Holloway, who did not seek reelection in Monroe, a city of 35,000 about 25 miles southeast of Charlotte. Burns highlighted his family, faith and business background on his campaign website.

Related: Vi Lyles wins fourth term as Charlotte mayor

“It’s been an awesome run so far, and now it’s all in God’s hands,” Burns said in a social media video minutes before the coin flip Friday.

Yanacsek, a former Charlotte-Mecklenburg police officer, posted a video after the vote asking supporters not to be discouraged by the outcome.

“We didn't lose the election. We lost a coin toss," he said.