In 1689 O'Gara was a member of the Patriot Parliament where he represented the constituency of Sligo County. During the War of the Two Kings he was given command of a newly raised infantry regiment in the Irish Army which took part in an expedition led by Patrick Sarsfield to capture the Protestant-held town of Sligo. In 1690 O'Gara commanded the Jacobite garrison at Jamestown in County Leitrim, repulsing an advance by a much larger force of Williamite troops under James Douglas. In 1696 O'Gara became the proprietor of O'Gara's Dragoons.