Prince William and Kate Middleton
Should William and Kate have a daughter as their first born, she will "rightfully" become Queen of England REUTERS

Britain's Succession Act, which declares that a male heir to the throne has rightful precedent over an elder sister, has been changed.

The new law says the eldest child, regardless of gender, will become the monarch.

It means that if Prince William and the Duchess of Cambridge have a daughter as their first-born, she will one day be Queen.

Prime Minister David Cameron, speaking at the Commonwealth Heads of Government Meeting in Perth, Australia, said it was "right" that the law should be changed to align the monarchy with modern times. "The wedding this year of Prince William to Kate Middleton means that the issue cannot be deferred any longer."

In a unanimous agreement with the Commonwealth nations, sons and daughters of any monarch will also be allowed to marry a Catholic.

The first female Australian prime minister, Julia Gillard, said she was delighted, "speaking from a female's point of view," that the act had been changed.

The law, more than 300 years old, was changed in a matter of hours during the meeting.