Imagine waking up after a night out, feeling a little worse for wear, and finding a frightened penguin at the foot of your bed.

That is what happened to a pair of Welshmen Down Under, who, after drinking 1.5 litres of vodka, ended up with a seven-year-old fairy penguin named Dirk.

Yesterday, they found themselves in court, where they admitted trespass, and stealing and keeping a protected animal.

It is not clear if Rhys Owen Jones, 21, and Keri Mules, 20, drew any inspiration from The Hangover, the 2009 comedy directed by Todd Phillips where a band of wild partygoers wake up in a wrecked Las Vegas penthouse to find a tiger in the loo.

But the duo, who are on working holidays in Australia, appear to have sailed comically – and, no doubt, merrily – close to the plot after letting loose at a beach party last month. After drinking heavily, Jones, who is said to be a former Royal Marine, and Mules broke into the Sea World theme park on Queensland's Gold Coast. James Vasilj, an 18-year-old Australian, is also alleged to have been with the pair on the night and is facing a single charge of trespass.

What followed is a tale as surreal as any dreamt up by Hollywood writers: sozzled and seeking communion with the local marine life, the pair went swimming with dolphins and let off a fire extinguisher near the park's Shark Bay.

"I'm not sure if a little bird popped into their heads but they thought a swim with the dolphins might be nice," their lawyer, Bill Potts, told Southport magistrates' court, according to The Australian.

In a final flourish that resulted in a A$1,000 (£640) penalty for each of the Britons, they ran off with the fairy penguin. When they woke up and found the hapless hostage in their room, they tried to feed it bread and put it in the shower. Finally, they panicked and decided to release Dirk into a nearby canal. Locals spotted the pair with the penguin and called the police.

Speaking in court, Mr Potts said the Welshmen meant no harm. "They tried their incompetent best to care for the penguin," he explained.

The two have since written a letter of apology to Sea World and the Australian public. Meanwhile, Dirk, who was unharmed, is back in his tank after being rescued and reunited with his partner, Peaches.

The presiding magistrate, Brian Kucks, warned that the night could have ended very differently for Jones and Mules.

"You could have found yourselves in a morgue if you'd gone into the wrong enclosure," he said. "Perhaps next time you are at a party you will consider drinking a little less vodka."