The election results are said to highlight the growing rift between religious and secular Jews in Israel's poorest city.
Barkat will succeed Uri Lupolianski, the first ultra-Orthodox Jew to serve as mayor of Jerusalem.
Porush, 53, also a powerful figure on the ultra-Orthodox national political scene, ran an intense campaign against Barkat.
With a high birth rate and government financial support, ultra-Orthodox Jews are a growing proportion of Jerusalem's population, while many secular Jews are leaving the city because of their lack of control and rising municipal taxes.
A former member of the Kadima party, Barkat prides himself on having quit the centrist party after "exposing" an alleged plan by Haim Ramon's, the vice premier, to divide Jerusalem.
He won the backing of the city's right-wing parties over his refusal to return any parts of east Jerusalem, which Israel occupied and annexed in 1967 and where the Palestinians wish to make the capital of their future state.
"Jerusalem has to stay unified," he said.
He also reiterated his plans to keep building Jewish settlements in Jerusalem, a move deemed illegal under international law.
About 750,000 people live in Jerusalem, including 260,000 Palestinians. Palestinians who, along with most world powers, do not recognise Israeli rule of occupied East Jerusalem and have largely boycotted the vote.
The mayor of Jerusalem has no official standing in Israeli-Palestinian negotiations, but one area of agreement between Porush and Barkat is opposition to division of Jerusalem as part of a peace deal.
Instead, the two leading candidates favour building thousands more apartments for Israelis in the disputed part of the city, angering Palestinians.