The government has released an official statement confirming the reports but has not revealed the names or nationalities of the individuals.
The men arrived on a small plane in Mogadishu, which was waiting for a second small plane to come in, collect the cash and fly it to another destination in the country, officials say.
Reports suggest the sum was in excess of two and a half million euros.
Heavily armed pirates using speedboats operating from Somalia have been attacking ships over a vast area for a number of years, despite the presence of warships from navies around the world.
Although there is still no evidence that the men were delivering a ransom, it would not be the first attempt to do so.
A record was set last November when six million euros was paid for the release of the Samho Dream, according to pirates.
And in late 2009 a Spanish trawler, the Alakrana, was released along with its crew of 36 against a ransom of four million dollars.