The UN says the arms were part of legitimate consignment for its mission in the Democratic Republic of Congo.
Drugs tests carried out on a substance found around some of the UN vehicles were negative, the police said.
The vehicles were allowed to be reloaded on board before the ship left, but the police have retained the arms.
The rifles and rocket-propelled grenades, which were among the weapons found inside the UN vehicles, would be delivered under Kenyan escort to Indian peacekeepers in DR Congo, Mombasa County police commander Francis Wanjohi said.
He said it would be too dangerous for the MV Hoegh Transporter to continue its journey if it was common knowledge there were weapons aboard, because of the threat of piracy.
The ship had been sailing from Mumbai in India, but its final destination is unknown.
The BBC's Ferdinand Omondi in Mombasa says the dramatic midnight raid on the vessel after it had docked on Thursday night involved several elite Kenya police units, including the narcotics squad and the criminal investigation department.
The whole port was shut down and people asked to leave as it searched the ship, he says.
The UN's Nairobi office said the misunderstanding over the weapons, often stored in vehicles for to avoid damage in transit, was down to a clerical error.
It said although the weapons were not declared in the manifest, a separate declaration accompanying the military vehicles was attached.
A UN spokesman further explained new vehicles often had anti-humidity powder put around tyres for long shipments.
Hoegh Autoliners, the owners of the ship, were contemplating suing the state for damages and defamation, a lawyer representing them in Kenya, said.
"The hullabaloo was so much ado about nothing," Cliff Ombeta told Kenya's Star newspaper.
UN's mission in DR Congo is one of the organisation's biggest peacekeeping operations, with nearly 20,000 personnel.

He was injured in a tumble from Cernunnos, for his boss JP McManus, at the final fence in the Summer Plate Handicap Chase won by Long House Hall.
Geraghty, 36, will see a specialist to determine whether he needs surgery.
"He'll be out for two to three months with that," said Irish Turf Club senior medical officer Dr Adrian McGoldrick.
The first big meeting in Ireland that Geraghty will miss will be the seven-day Galway meeting, which starts on 25 July.
A Norwegian ship detained in Kenya's Mombasa port for more than a week on suspicion of carrying drugs and illegal weapons has been released.
[NEXT_CONCEPT]
Jockey Barry Geraghty will miss the Galway Festival and is out for at least two months after breaking his right arm in a fall at Market Rasen.