DHAKA (Reuters) - Mutinous members of a paramilitary unit in the Bangladesh capital surrendered their weapons on Thursday as tanks surrounded their headquarters after a second day of gunfire in a mutiny that killed about 50 people.

Government officials and police said the mutiny in Dhaka was under control and urged members of the Bangladesh Rifles (BDR) border guards who had also mutinied elsewhere in the country over pay and command issues to lay down their arms.

Gunfire gradually subsided and stopped in the capital after Prime Minister Sheikh Hasina warned of tough action in a national broadcast, a day after offering the mutineers an amnesty.

All the rebel troops have surrendered with their arms and the process has been completed, Hasina's media spokesman Abul Kalam Azad said of the BDR troops in the capital.

At least 20 government tanks and 15 armored personnel carriers were in position around the BDR headquarters in Dhaka, where violence on Wednesday killed nearly 50 people.

Hundreds of BDR mutineers handed over their weapons, including automatic rifles, machine guns and grenades, to police who locked the munitions inside two armories in the BDR complex.

Police have locked the armories and handed me over the keys after the troops completed the surrender, Home Minister Sahara Khatun told reporters outside the BDR headquarters.

Hundreds of regular soldiers in battle dress surrounded the BDR headquarters as the surrender was completed. About 60 BDR troops who tried to flee the compound were arrested, police said.

They said about 200 BDR officers who had been held hostage by the mutineers inside the complex were released safely.

The turmoil underscores the challenges faced by Hasina, who took office only last month after winning parliamentary elections in December that returned Bangladesh to democracy after nearly two years of army-backed emergency rule.

CALM RETURNING

The mutiny began on Wednesday at the BDR's headquarters. Shooting there and in the immediate vicinity accounted for the known deaths so far. Among the dead were eight army officers and six civilians, police said.

Shooting incidents involving BDR troops erupted in more than a dozen other towns on Thursday, local police said, but Reuters reporters later said calm was gradually returning.

Mobile phone services were ordered cut by the government to stem rumors and misinformation, one operator said, making it difficult to find out what was happening around the impoverished South Asian nation. Coverage resumed later on Thursday.

Lay down your guns immediately and go back to barracks. Do not force me to take tough actions or push my patience beyond tolerable limits, Hasina warned restive BDR troops in her national broadcast on Thursday afternoon.

Give democracy and the economy a chance to develop.

Dhaka streets were largely deserted and residents were tense as they waited to see what happened next.

Bangladesh, home to more than 140 million people, has had several military coups since independence in 1971, but this week's mutinies are over pay, benefits and command structure, officials and local media said, not politics.

Traditionally the BDR is led by army officers. Some BDR troops want commanders drawn from their own ranks.

Hasina said she was prepared to do as much as she could to meet their demands gradually but said they must first surrender.

The main duty of the BDR troops is guarding the country's borders, but they often back up the army and police.

As the government worked to restore order in Dhaka earlier on Thursday, shooting began from BDR units scattered across the country. A Reuters reporter in Sylhet in the northeast said BDR troops were coming on the street holding up guns and shooting.

BDR members barricaded a highway linking two districts in the southern region while they took over camps from army commanders at several places, local officials said. There were no immediate reports of casualties in those actions.

The unrest is a blow to hopes Hasina's government could bring stability that would attract much-needed investors and boost development to Bangladesh, where around 40 percent of the populace live below the poverty line.

Analysts said the mutinies pose a major challenge for Hasina in keeping together the powerful defense forces -- which have often intervened in the country's politics -- and in tackling their grievances without risking further discord.

This poses a huge challenge for the prime minister and her government, who need to be tactful in trying to resolve it, said retired Major General Azizur Rahman, a former BDR chief.

(For related Q&A and Timeline click on [nSP492625] and [nDHA361689])

(Additional reporting by Nizam Ahmed, Ruma Paul, Serajul Islam Quadir, Azad Majumder and Rafiqur Rahman; Editing by Paul Tait)