Reagan's widow Nancy has led a week of mourning
Past and present world leaders were among some 4,000 people packing Washington's National Cathedral on Friday for the funeral of former president Ronald Reagan.
The New York Stock Exchange and government offices are closed for what is an official national day of mourning.
Millions were expected to tune in for the live television broadcast of the national funeral, which began at around 1130 EDT (1530 GMT).
Reagan's coffin was brought from the US Capitol where it lay in state since Wednesday evening.
President George W Bush, his father and former president George Bush, former prime ministers Margaret Thatcher of Britain and Brian Mulroney of Canada all gave eulogies.
Other dignitaries included Britain's Prince Charles representing his mother, Queen Elizabeth II, Prime Minister Tony Blair, German Chancellor Gerhard Schroeder, South African President Thabo Mbeki and Afghan President Hamid Karzai.
All four surviving former US presidents - Gerald Ford, Jimmy Carter, Bill Clinton and George Bush Sr - attended, as did the last Soviet leader, Mikhail Gorbachev.
The service was conducted by former US Senator Jack Danforth, an ordained Episcopal minister and the current nominee to become US ambassador to the United Nations.
Readings were given by Rabbi Harold Kushner and Sandra Day O'Connor, who became the first woman to serve on the US Supreme Court after she was nominated by President Reagan in 1981.
Reagan had been planning his own funeral arrangements since 1981, just one year after taking office, said family spokeswoman Joanne Drake.
The chosen hymns included The Battle Hymn of the Republic, Beethoven's Ode to Joy and Amazing Grace.
The cathedral's Bourdon Bell ended the service by tolling 40 times, to recognise Reagan as the 40th US president.
1430 GMT: Coffin leaves Washington's US Capitol
1530: Funeral service at Washington National Cathedral
1815: Departure ceremony at Andrews Air Force base
2345: Aircraft arrives in California
0115 Saturday: Private internment service
Security for the event - as for the lying in state in both California and Washington - has been extremely tight.
Following the national funeral, the president's body is returning to California.
After a ceremony at Andrews Air Force base, an aircraft carrying the coffin departed at 1445 (1845GMT) and was due to arrive in California five hours later.
The coffin will then be taken by motorcade to the Ronald Reagan Presidential Library in Simi Valley, north of Los Angeles, at 1800 local time (0100GMT on Saturday).
There will be a private sunset ceremony on a hill overlooking the Pacific Ocean, attended by some 700 family and friends, including Hollywood actors Charlton Heston and Kirk Douglas.
The iconic former president, credited with helping to end the Cold War and change US political culture for a generation, will be buried at 1930 (0230GMT on Saturday).
Friday's funeral and burial cap a week of ceremonies that began on Monday with a private ceremony for his family at the Reagan library.
After the service, the former president's body lay in a closed casket in the library's main lobby for 30 hours of public visitation.
The coffin was flown from California to Washington DC on Wednesday.
Reagan was president for eight years
The body lay in state throughout Thursday in the Capitol Rotunda, on a catafalque built in 1865 for Abraham Lincoln's coffin.
The state funeral was the first since that of former President Lyndon Johnson in 1973.
Only one other former president has died in the interim, Richard Nixon.
Nixon, who resigned in disgrace following the Watergate scandal, had asked not to have a state funeral.
All presidents are entitled to state funerals, though Nixon was not the only one to forgo the honour.
Franklin D Roosevelt - an early hero of Reagan's - chose not to have one.