SUVA, Fiji (AP) _ Deposed Prime Minister Timoci Bavadra was released from prison today and announced that the army and Fiji's two main political parties would meet to resolve the nation's political crisis.

Bavadra was arrested Saturday, one day after Col. Sitiveni Rabuka staged his second coup in five months. Rabuka said he overthrew Bavadra's elected government May 14 to restore political rights to Fiji's native population, which is outnumbered by ethnic Indians.

Bavadra said an agreement was reached today during a meeting that brought together himself, Rabuka, Governor-General Ratu Sir Penai Ganilau and former Prime Minister Ratu Sir Kamisese Mara.

He said Rabuka's plans for a Fijian republic have been placed on hold. Rabuka had announced plans for Fiji to become a republic with a new constitution scrapping the office of governor-general, the representative of the British crown in this Commonwealth nation.

''We will try to find a peaceful solution,'' Bavadra told Fiji Times reporter Mala Jagmohan.

He said the Alliance and Coalition parties woud provide six delegates each and the army would have three. Bavadra heads the Coalition Party and Mara heads the Alliance Party.

Bavadra was released earlier today from Naboro prison, 12 miles west of the capital of Suva. Three party colleagues, also arrested Saturday, were likewise freed.

There was no immediate announcement from Rabuka, Ganilau or Mara.

Political observers said the agreement for a meeting opened the way for a peaceful resolution of a crisis that threatened to cause deep divisions among ethnic Fijians.

Rabuka said he staged the second coup because he had been unable to achieve the objectives that prompted his first takeover. He dissmissed Ganilau as head of a commission to form a caretaker government.

Earlier today, Rabuka declared in a statement that the armed forces were firmly behind him.

In a national address over army-controlled radio Tuesday, Rabuka declared Fiji a republic, appointed himself head of government and suspended the constitution.

Rabuka said Fiji, an ethnically divided South Pacific island nation 2,000 miles northeast of Sydney, Australia, was severing constitutional ties with Britain.

Bavadra, a leftist, defeated a pro-Western, Fijian-dominated government in April elections and named a Cabinet dominated by Indians. Violence then broke out between Indians and ethnic Fijians.

Rabuka had said he would appoint an interim council of ministers to rule until a new constitution was drawn up to ensure that ethnic Fijians retain political power over the larger Indian population.

Ethnic Fijians make up 47 percent of Fiji's 715,000 people, while ethnic Indians comprise 49 percent of the population. In London, the British government rejected the declaration and Queen Elizabeth II charged Rabuka with disloyalty to her. The queen is the formal head of state of Fiji under the constitution that took effect when Fiji became independent from Britain in 1970.