The appeals court said on Friday that a covert police recording of two suspects discussing blowing up one of the embassies was sufficient grounds to hold them for four weeks.
The court order to detain the men said: "The tape gave reasonable grounds to suspect a violation a 2002 law against plotting or preparing terror attacks. If charged and convicted they could face up to 12 years in prison."
Defence lawyers for the suspects dismissed the allegations, saying there was no evidence their clients took any steps to prepare an attack.
It was not immediately clear whether they would appeal the ruling.
The charges were in part based on recordings from an electronic bug in one suspect's car, in which the suspects discussed blowing up the embassies and cutting the throat of Israeli ambassador to Norway, Miriam Shomrat.
According to the 29-page ruling, Arfan Bhatti and Andreas Kristiansen drove around in Oslo in August, past the US and Israeli embassies, discussing how to attack them. They also discussed shooting embassy guards.
The court quoted one of the men as saying on the tape: "The problem with shooting them is that they don't come in one group. ... They come in waves. So shooting won't work. The only thing I thought was: do the whole building."
They were apparently unaware of the police electronic surveillance equipment planted in the car.
Arfan Qadeer Bhatti, 29, a Norwegian of Pakistani origin, and described as the ringleader by police, had been under surveillance since late June, after he was briefly detained by German police on suspicion of plotting terror against the World Cup soccer tournament. He was released without charges.
The men were arrested on Tuesday in connection with a shooting at the Mosaic Religious Community synagogue. The building was hit by 13 bullets early on Sunday. No one was injured.