MUMBAI (Reuters) - Indian Prime Minister Narendra Modi passed the first big political test of his third term on Wednesday as a ruling party candidate was elected speaker of the lower house of parliament, defeating an opposition lawmaker by a voice vote.

Om Birla, from Modi's Bharatiya Janata Party (BJP) who was speaker in the last term of the house, was elected again, beating K Suresh, an eight-time MP from the opposition Congress party.

Congress leader Rahul Gandhi, who was declared the leader of the opposition late on Tuesday by his party, accompanied Modi as they congratulated Birla on his election, a rare show of harmony between the two bitter rivals.

This is the first time that Gandhi, 54, the scion of the Nehru-Gandhi family, will assume a constitutional role in the parliament, a role that gives him the status of a cabinet minister.

"It is very important that the voice of the opposition is allowed to be represented in this house," Gandhi said in his speech while congratulating Birla.

The speaker of the Lok Sabha, as the lower house is known, is usually a lawmaker from the biggest party and is usually elected unopposed, through a consensus between parties.

The BJP-led National Democratic Alliance has 293 lawmakers in the lower house, 21 more than the required majority of 272.

Modi, who was sworn in as prime minister for a record-equalling third time on June 9, will need the support of regional parties to run his government in his third term, after his party lost its outright majority in parliament.

The speaker, who conducts business in the decision-making lower house and presides over it, is critical to the passage of laws.

(Reporting by Shilpa Jamkhandikar; Editing by Raju Gopalakrishnan)