James II was overthrown in a hostile takeover of the British throne by his daughter, Mary II, and his son-in-law, William III, during the Glorious Revolution in 1688. They ruled collectively as co-regents as William & Mary.

James II assumed the throne in 1685 after the death of his brother. His religion, Roman Catholic, plus his policies of religious toleration deeply troubled the leading political circles who were Anglican. The disruption of the English Civil War, including the execution of Charles I, was in living memory. Therefore, the powers that be were content to bide their time as James was already past his prime and as his daughter Mary, the heir presumptive, was Anglican.

A new urgency came about when James II's second wife gave birth to a boy who was baptized a Catholic, thus guaranteeing a Catholic dynasty. Parliamentary members conspired with William, Mary's husband, to overthrow his father-in-law. After gaining enough financial and political support, William landed in Torbay, England with an army. After some minor resistance, James II fled as he was unable to garner enough support for his cause.

With French support, James II attempted to fight on in Ireland, which had a large Catholic population. But even here, he was defeated. William & Mary were crowned on April 11,1689, swearing to uphold the laws made by Parliament. This included Catholics being denied the throne and occupying a seat in Parliament.

More Info: en.wikipedia.org