A sloth broke into a restaurant in the middle of the night.

Sloth breaks in

Sloth breaks in

The mammal beat the security gates at Café Milagro in Costa Rica and was seen climbing up to the counter before playing with a spinning display in the hope of nabbing a snack.

However, the sloth landed itself in hot water when it accidentally lost its footing and fell to the floor with a bang which, in turn, alerted the security guards to the break in.

Co-owners Travis Day and Adrienne Pellizzari were called out in the middle of the night to relocate the intruder and they watched the footage in the morning.

Travis is quoted by the Metro newspaper as saying: ''The sloth must've slipped through the gates after we'd already closed - they're very common in the area.

''It was funny to see that it was all caught on video, but most importantly that we had been able to relocate the sloth back outside in the middle of the night.

''We didn't realise just how hilarious it was until we shared it with family and friends. While we have sloths that can be regularly seen in nearby trees, this was the first invasion of our actual restaurant.

''We have a resident sloth named Terrance who can regularly be found behind our restaurant but this one was a new visitor.''