By Adama Diarra and Tiemoko Diallo

BAMAKO (Reuters) - Heavy gunfire erupted near Mali's state television in Bamako on Tuesday on the second day of fighting between forces from the ruling junta and soldiers believed to be loyal to ousted President Amadou Toumani Toure, witnesses said.

Loud gunfire rang out from the direction of the television building, Reuters witnesses said, and people were fleeing the area along the road to the building.

"We were on our way there, but were told there is fighting going on around the ORTM (state television) and we were told to go back," one witness said.

The military junta said the fighting, which broke out late on Monday, was an attempt to reverse a March 22 coup that ousted Toure, adding that there was evidence that it was being backed by foreign fighters.

The coup, which derailed April elections meant to replace Toure and which came in the midst of a rebellion in Mali's desert north, has been internationally condemned, and West African regional bloc ECOWAS said it plans to deploy a force to oversee a transition back to democratic rule.

Speaking to a local radio station overnight, junta chief Captain Amadou Sanogo said the fighting broke out after he had sent some units to the presidential guard barracks to tell them that Malian forces should remain united.

"During the exchange between my guys and the paratroopers, some of them decided to battle us once and for all," Sanogo said. "They tried to seize Kati, take control of the radio and television and the airport. But we had been prepared. We managed to kill some and captured others. Among the captives there are foreign troops that we'll show on TV."

The junta said in a recorded statement, which is being replayed on state television, that it remained in control of the state broadcaster, the airport and the Kati base - which has been the headquarters of the junta leaders.

"These locations have been secured and are in the hands of the security forces," the statement, read by Lt. Mohamed Issa Ouedraogo, a junta spokesman, said.

The renewed fighting could be a setback for the West African nation after the junta had agreed to an interim government as a first step to restoring constitutional order since the coup.

(Additional reporting by Cheikh Amadou Diouara and Bate Felix; Writing by Bate Felix; Editing by Richard Valdmanis)