PERMET, Albania (AP) — Albania’s parliament elected its top military official as the country’s new president on Saturday after no candidates were nominated in three rounds of voting.

Gen.-Maj. Bajram Begaj won the post after the 140-seat Parliament voted 78 in favor, four against and one abstained.

The governing left-wing Socialist Party nominated and voted for Begaj, 55, after failing to reach a compromise with the opposition on a candidate to replace President Ilir Meta, and no independent candidate was nominated.

Most of the opposition voted against Begaj while another party boycotted the voting.

Begaj is post-communist Albania’s eighth president and the third from the military ranks.

The five-year presidency has a largely ceremonial role and the chosen candidate expected to stand above partisan divisions. It holds some authority over the judiciary and the armed forces and is limited to two terms.