Defender of Dunnottar Castle. Ogilvy was appointed Lieutenant-Governor of the castle by its owner, William Keith, the 7th Earl Marischal (c.1617-61). In 1651-2, Ogilvy and his small garrison held out against Cromwell, until starved into submission. However, he was instrumental in preventing the regalia of Scotland from falling into Cromwell's hands, arranging for these to be smuggled out of the castle and hidden in the church at Kinneff.
He was created a baronet in 1660 by King Charles II in recognition of his patriotism.