TRIPOLI, April 25 (Reuters) - Libya, preparing for elections in June, has banned political parties based on religion, tribe or ethnicity, a government spokesman said on Wednesday.

National Transitional Council spokesman Mohammed al-Harizy said the council passed the law governing the formation of political parties on Tuesday evening.

"Parties are not allowed to be based on religion or ethnicity or tribe," he told Reuters.

He did not make clear how this would affect a political party formed in March by Libya's Muslim Brotherhood and other Islamists. The new party is viewed as a leading contender in the June polls, the first since last year's overthrow of Muammar Gaddafi in a NATO-backed uprising.

Islamist parties had been expected to vie with secular ones for seats in a national assembly that will draft a new constitution for the North African country.

Political analysts say the Muslim Brotherhood is likely to emerge as the most organised political force and an influential player in the oil-exporting country where Islamists, like all dissidents, were harshly suppressed for 42 years.

Islamists have performed strongly in post-uprising elections in Tunisia, Egypt and Morocco since October and they are also likely to do well in Libya, a socially conservative country where alcohol was already banned before the revolution. (Reporting By Hadeel Al-Shalchi; Editing by Alistair Lyon)