The 25-year-old has put pen to paper on a two-year deal, with the Blues also holding an option on the former Spurs apprentice.
As reported by The News earlier today, Danny Cowley had identified Ogilvie to provide left-back competition for Lee Brown.
He had turned down a new deal at Gillingham to become a free transfer this summer, yet continued to train with Steve Evans’ side during pre-season.
Portsmouth boss Danny Cowley makes transfer admission as former Luton and Millwall midfielder edges closer to Fratton Park exit
Former Portsmouth keeper Alex Bass suffers tough night on and off the pitch as he makes Sunderland debut following Fratton Park exit
Predicted Portsmouth XI v Cheltenham: changes expected to side that beat Cardiff so handsomely - but attacking duo could keep places and defender set to return
Portsmouth transfer news: Blues youngsters attracting interest but Danny Cowley has no desire to cash in just yet
Ronan Curtis' Portsmouth future spelt out by trusted source well in the know - with advice on where to play Irishman added, too
The defender is Cowley’s ninth signing of the transfer window, with the League One season kicking off on Saturday at Fleetwood.
A message from the Editor, Mark Waldron
The News has launched a subscription offer which gives you unlimited access to all of our Pompey coverage, starting at less than 14p a day.
You can subscribe here to get the latest news from Fratton Park - and to support our local team of expert Pompey writers.