Ali Zeidan’s office said he had asked for clarification and stressed Libya was “keen on prosecuting any Libyan citizen inside Libya”. The raid captured al-Qaeda leader Anas al-Liby, a suspected mastermind of the 1998 US embassy attacks in Africa.
US Secretary of State John Kerry said the suspect was a “legal target”.
Mr Kerry said Anas al-Liby would face justice in a court of law.
On Saturday, US commandos also carried out a raid in southern Somalia but failed to capture its target.
The US Navy Seals’ seaborne raid was believed to have focused on a leader of the al-Shabab militant group, which says it carried out last month’s attack on the Westgate shopping centre in the Kenyan capital, Nairobi, leaving at least 67 people dead.
A US official speaking on the condition of anonymity later identified the militant as Ikrima – a foreign fighter commander for al-Shabab in Somalia, Reuters reports.
However, Washington has not formally named the intended target.
When asked on Sunday whether Somalia had been aware of the raid, Prime Minister Abdi Farah Shirdon Saaid said: “Our co-operation with international partners on fighting against terrorism is not a secret.”
A press release posted on an official Libyan government website read: “The Libyan government is following the news about the Libyan citizen wanted by the US government.
“Since we’ve heard, we have been in touch with the US government and have asked for clarification on this matter.
“The Libyan government is keen on prosecuting any Libyan citizen inside Libya, no matter what the charges are… the accused are innocent until proven guilty.”
The statement raises questions about how much, if anything, Libya knew in advance of the raid.
A US official had been quoted by CNN as saying that the raid was conducted with the knowledge of the Libyan government.
Anas al-Liby, 49, is believed to have been one of the masterminds behind the 1998 US embassy attacks, which killed more than 220 people in Kenya and Tanzania.
He has been indicted in a New York court in connection with the attacks.
Liby – whose real name is Nazih Abdul-Hamed al-Ruqai – has been on the FBI’s most wanted list for more than a decade with a $5m (£3.1m) bounty on his head.
A Pentagon statement on Sunday said he was “currently lawfully detained under the law of war in a secure location outside of Libya”.
It said: “The successful capture operation was made possible by superb work and co-ordination across our national security agencies and the intelligence community, and was approved by President Obama.”
No American personnel were injured, it said.
Anas al-Liby was seized in Tripoli early on Saturday as he was parking outside his house.
Three vehicles encircled him, his car window was smashed and his gun was seized before he was taken away, his brother, Nabih, told the Associated Press news agency.
On Sunday he told reporters that his brother was innocent, describing the US operation was an “act of piracy”.
Liby’s son, Abdullah, said that those he could see taking his father looked Libyan and spoke a Libyan dialect. He said that some were masked.
Mr Kerry said the operations in Libya and Somalia showed that the US would never stop “in its effort to hold those accountable who conduct acts of terror”.
Those who attacked American interests “can run but they can’t hide”, he said.
The US defence department also confirmed that special forces had carried out a seaborne operation in Somalia’s coastal town of Barawe on Saturday.
Pentagon spokesman George Little said the forces had been “involved in a counter-terrorism operation against a known al-Shabab terrorist”. He gave no further details.
Initial reports in the US media quoted unnamed US officials as saying that the suspect had been captured or killed by US Navy Seals in the pre-dawn raid on a villa.
However, the officials later said that the Seals failed to find the intended target.
Prime Minister Saiid said on Sunday: “We have collaboration with the world and with neighbouring countries in the battle against al Shabab… our interest is to get a peaceful Somalia, free from terrorism.”
The raid was carried out by members of Seal Team Six – the same unit that killed al-Qaeda leader Osama Bin Laden, a US military official told AP.
The official added that in Barawe the commandos had decided to abort the mission after encountering fierce resistance from al-Shabab fighters.
“The Barawe raid was planned a week and a half ago,” a US security official told the New York Times.
“It was prompted by the Westgate attack,” added the official, who was speaking on the condition of anonymity.
Al-Shabab earlier told the BBC that “white soldiers” had arrived by boat in Barawe and rebels had repulsed them, losing a fighter.