When news broke of the Prime Ministers detention hundreds of people poured out on to the streets to demand Mr Gomes Junior be freed. Witnesses say he was released and is now under house arrest.
Rebellion leader Gen Antonio Indjai threatened to kill the prime minister if the protests did not end.
But he later said the day's events had been a military problem, not a coup.
Portugal and France have condemned what they termed a coup, with Lisbon calling for a return to constitutional order in its former colony.
Since gaining independence from Portugal in 1974, Guinea-Bissau has suffered several coups - and last year, army officers assassinated President Joao Bernardo Vieira.
Read more about Attempted Coup in Guinea-Bissau...
Click for more articles on Guinea-Bissau