Prince Charles will attend the funeral of former South African president Nelson Mandela next Sunday.
A Buckingham Palace spokeswoman said he would be representing the Queen at the service in Qunu, South Africa, on December 15.
Prime Minister David Cameron has said on Twitter that he will be at Mr Mandela's memorial service on December 10.
Charles, who has made several visits to South Africa, is understood to have sent a private letter of condolence to Mr Mandela's widow Graca Machel following his death last week.
The Duchess of Cornwall will not be accompanying him to the funeral, a Clarence House spokeswoman said.
Mr Cameron wrote on Twitter: "I'll be at the memorial service in South Africa on Tuesday to commemorate the great man. #RIPMandela."
The official memorial service will take place at the FNB Stadium in Johannesburg, the South African government said.
A message on the government website said it would be attended by members of the public as well as heads of state.
"This will give ordinary people and public leaders an opportunity to celebrate Madiba's life collectively," they said in the statement, using the clan name Mr Mandela was affectionately known by.
A state funeral will be held days later, with the South African government saying "a funeral service and interment ceremony will take place at President Mandela's home and final resting place at Qunu in the Eastern Cape."
Charles and Prince Harry visited South Africa in 1997 and met Mr Mandela at his Pretoria residence. The previous year, Charles had hosted Mr Mandela on a visit to Brixton during his first state visit to the UK.
The most recent trip to South Africa for Charles was in 2011, when he and Camilla made an official visit to Tanzania and South Africa. On that occasion, they visited the Nelson Mandela Foundation in Pretoria and were greeted by Mrs Machel.
The Archbishop of Canterbury praised Mr Mandela for his "extraordinary" courage at a service of thanksgiving earlier today.
The Most Rev Justin Welby told a congregation at St Martin-in-the-Fields in London's Trafalgar Square that the 95-year-old was the "rarest of leaders" as he thanked God for his life.
The archbishop read the sermon at the service, saying: " Nelson Mandela showed his courage by his determination in the face of evil and by his humanity in the experience of victory.
"What is more, such courage and humanity were learned and demonstrated in the mists of conflict and suffering. He was that rarest of leaders, those who learn from terrible events so as to exhaust all their lessons, rather than being shaped by them into bitterness and hatred."
He called for prayers for South Africa as the nation mourned Mr Mandela and sought to find those to continue his work.
The service was led by the Rev Dr Sam Wells, vicar of St Martin's. He told the congregation: "It would be hard to name a world figure in the last 30 years more universally respected than Nelson Mandela.
"Today all the people of the nations of the world grieve his death."
The service was broadcast on BBC Radio 4 and featured a live link to Christ the King Church in Sophiatown in Johannesburg. Former Poet Laureate Andrew Motion read a poem called To Nelson Mandela: A Tribute during the service.
Westminster Abbey will hold a national service of thanksgiving for the life of Mr Mandela after his state funeral, and Parliament will hold a special ceremony to commemorate his life. A book of condolence has been opened in St Margaret's Church at the abbey.
The Queen is also understood to have written to Mrs Machel expressing her sympathies.
She has visited South Africa on numerous occasions and hosted Mr Mandela on his two state visits to the UK, in 1996 and 2001. The Queen also received him at Buckingham Palace in 2008, during a visit to London to mark his 90th birthday.