Sole candidate Habib el-Malki, a leftist economist who has held several ministerial posts, mustered 198 votes in the 395-seat house, in a plenary session broadcast live online.
King Mohammed VI has called on parliament to ratify laws by Friday to clear the way for Morocco's return to the African Union at a summit in Addis Ababa at the end of January, according to legislators.
The country, however, is in an unprecedented political deadlock after its Islamist premier, Abdelilah Benkirane, last week broke off talks on forming a new coalition government following three months of fruitless efforts.