A MAN hid for five days in the organ loft of Dornoch Cathed-ral and filmed the entire baptism of Madonna's four-month-old son Rocco, it emerged last night.

His attempt to record the showbusiness event of the year, was foiled when he was found in the loft during a security sweep an hour after the christening. It is believed he was intending to sell it to the highest media bidder.

Police yesterday confiscated his recording equipment and charged him, and another man arrested early yesterday in a Dornoch hotel, with unspecified offences. A number of items contained in two black bin bags were removed from the cathedral by officers.

Northern Constabulary later said the two men, aged 51 and 33 and both from the south of England, had been released and were expected to appear at Dornoch Sheriff Court early next week charged with a number of offences. It was not thought the incidents were connected.

One report said the man found in the loft was a former member of the SAS.

The security breach illustrated why Madonna and Ritchie decided to use nearby Skibo Castle for last night's wedding service. Its security cordon remained intact and, since the couple decided not to offer a media photocall, few details of the wedding are known.

The image of Skibo as an almost invincible haven for media-shy celebrities will also have been enhanced, by contrast, with the arrest at the cathedral, which had been under the direct supervision of Rock Steady, the private security firm, supplemented by officers from Northern Constab-ulary, and Madonna's own bodyguards.

However, earlier in the week, a photographer managed to infiltrate Skibo and spent two days sleeping rough on the estate before being discovered.

Inevitably, Madonna will also have been reminded of her marriage to actor Sean Penn in a private cliff-top ceremony in Malibu, California, in 1985.

American tabloids hired helicopters to snap the couple, but media-shy Penn scrawled the words ''f*** off'' in 6ft high letters on the beach. The couple divorced four years later.

Ironically, the cathedral incident came on the same day that Hollywood stars Michael Douglas and Catherine Zeta Jones persuaded a court that celebrities have rights to privacy.

The Court of Appeal ruling, which raised the issue of celebrities accepting publicity with one hand and pushing it away with the other, will enable the newlyweds to sue Hello! magazine for millions of pounds after it published ''surreptitious'' photos of their wedding last month.

Arguably, any attempt by the cathedral intruder to sell his illicit recordings could have been challenged by Madonna and Ritchie under that legal precedent.

The man is understood to have video recorded the entire 30-minute service. He is expected to face charges relating to breach of the peace.

The incident caused a major security scare and is an embarrassment for Madonna's security staff, particularly Jackie Jackson, her trusted deputy head of security who oversaw the ceremony at the cathedral.

A spokesman for Rock Steady confirmed that a man had been found inside the organ loft. ''We did a thorough search before the event and a search of the building afterwards. We are pleased that he was discovered and did not get away with what he was trying to get away with.''