The Colombian government quickly agreed tonight to negotiate with guerrillas holding about 45 hostages here after the leftists threatened to kill two captive ambassadors by 10 p.m.

Guerrillas who seized the Dominican Republic's embassy on Wednesday had freed their five remaining female hostages this morning. But the guerrillas later accused the government of stalling on promised negotiations and set the deadline.

President Julio Cesar Turbay Ayala then broadcast over all Colombian radio networks acceptance of the demand to open talks immediately in a station wagon to be parked outside the besieged embassy. Earlier, the government had conditioned any negotiations on the guerrillas agreeing to certain undisclosed conditions.

The guerrillas' terms were transmitted by phone lines remaining open to the embassy. A spokeswoman for the guerrillas told a radio station that two of the 14 ambassadors held captive hae been selected to be shot.She did not name them.

Among those held is Ambassador Diego C. Asencio of the United States.

This morning guerrillas fired three shots from inside the embassy, apparently believing that the 500 military police surrounding the three-story building were about to storm it.

A government statement at that time said Foreign Minister Diego Uribe Vargas had specified the conditions for talks in a phone conversation with one of the captive ambassadors.

A high-ranking Colombian military officer attached to the Defense Ministry said he believes the government has decided to take a hard-line approach in an effort to wear down the guerrillas.

It is believed that President Turbay is unlikely to agree to the guerillas' principal demand -- the release of 311 political prisoners from Colombian jails.

The Defense Ministry official said the government does not believe that the M19 guerrillas who seized the embassy are as disciplined or brutal as the Argentine Montoneros, Italy's Red Brigades or West Germany's Baader-Meinhof Gang.

It is the government's working assumption that the M19 guerrillas do not want to kill their hostages and that they may settle for substantially less than their original demands, which included a ransom of $50 million and safe passage out of Colombia. Costa Rica has offered the guerrillas asylum as did Panama. A guerrilla spokesman thanked the Panamanians but said the 311 prisoners would have to be included.

Among the women released today was Costa Rican Ambassador Maria Elena Chaussou, reducing the number of ambassadors being held hostage to 14. In addition, there are two charges d'affaires, of Paraguay and Bolivia, in the embassy as well as other diplomats, servants and waiters hired for the Dominican national day party under way when the takeover occurred.

Fifteen women, two wounded men and a young messenger boy were released yesterday. The total of remaining hostages is now estimated at about 45.

Colombian Alfredo Vasquez Carrizosa, a former foreign minister who met with the guerrillas Wednesday night and transmitted their demands to President Turbay, said in an interview today that the guerrillas' "Commander No. 1" impressed him as "a man with a knowledge of revolutionary strategy.

"He is a man aware and conscious of his role as a commander. My guess is that they could carry out an act of violence . . . because they believe they will be killed if they are taken prisoner."

The former foreign minister, who is also head of Colombia's principal human rights group and a former ambassador to the Organization of American States, said he did not know what the government's conditions were for beginning negotiations. "My guess is they are very far from the guerrillas,'" he said.

The Defense Ministry officer said troops surrounding the embassy are well trained and will not act precipitously. He denied rumors that Israel or any other country had sent antiterrorist squads to aid the Colombian armed forces. oIsrael's ambassador is among the hostages.

The military officer also said it was true that the ambassadors of the Soviet Union, Hungary and two other Eastern bloc countries had been at the embassy and had left shortly before the takeover.

But he said East Germany's new ambassador presented his credentials earlier that day and the four ambassadors had left to attend a lunch in his honor. There was no indication, he said, that the four had been forewarned.

Vasquaz Carrizosa said he estimated that there were about 50 to 55 hostages in the embassy when he was there Wednesday night, although he said many of them were on the second floor and he could not be sure of the number. U.S. officials here have said the original number was about 80. What is certain is that 18 have now been released. The guerrillas have said they have 30 of their members in the embassy but most other reports indicate 12 entered the embassy Wednesday. One was killed in initial crossfire.

Vasquez Carrizosa said the leader appeared to be in his early thirties and was accompanied by two other guerrillas, a man in his early twenties and a woman in her late thirties.

The former diplomat said he was surprised that the Colombian government had not provided routine security for the embassy, especially when so many important ambassadors were scheduled to be there.

He was also surprised, he said, that there was not even a butler at the door to raise an alarm when the guerrillas, dressed in jogging suits and carrying sacks and suitcases, entered what was otherwise a formal cocktail party at the embassy.