The Dean of Windsor paid tribute to Prince Philip’s “kindness, humour and humanity” during the ceremony.
The congregation wore masks and was socially distanced in line with Covid rules, with the Queen seated alone.
The duke’s children walked behind his coffin in a funeral procession, followed by a national minute’s silence.
More than 730 members of the armed forces took part in the event, but there was a limit of 30 mourners inside St George’s Chapel, under coronavirus rules.
Prince Philip died at Windsor Castle on Friday 9 April, aged 99.
His coffin was carried the short distance to St George’s Chapel on a modified Land Rover, which the duke himself helped to design.
The funeral procession was headed by the Band of the Grenadier Guards, the Major General’s party, and military service chiefs.
Princess Anne and Prince Charles made up the front row behind the vehicle, followed by Prince Edward and Prince Andrew.
Prince William and Prince Harry walked either side of their cousin Peter Phillips.
The brothers sat on opposite sides of the aisle but were seen chatting together after they left the service.