The intimate 45-minute service was conducted by the Archbishop of Canterbury at the Chapel Royal on Tuesday evening.
They were joined by Prince Charles and the Duchess of Cornwall, but neither Prince William nor the Queen were present.
Miss Markle’s baptism, which formally introduces her into the Anglican faith ahead of her wedding to Harry in two months, marks an important step on her transformation from divorced American actress to future granddaughter-in-law to the Queen.
The ceremony was a closely-guarded secret with only a handful of royal aides involved.
Miss Markle, 36, had asked the 62-year-old Archbishop, Justin Welby, to lead the service after forming a close bond with him in recent weeks as he instructed her on the rites and sacraments of the Church.
Her baptism was followed immediately by her confirmation, which means she will be able to join Harry, 33, at Holy Communion.
Miss Markle did not need to become an Anglican in order to marry Harry in church, but at the time of their engagement last November she made clear she had chosen to be baptised and confirmed out of respect for the Queen’s role as the head of the Church of England.
Insiders also said it was fitting that the Prince of Wales, who will be the next head of the Church, attended the service.
Miss Markle and Harry will marry on May 19 at St George’s Chapel in Windsor Castle. The marriage service will be conducted by the Dean of Windsor, David Connor, with the Archbishop presiding as the couple make their vows.
Tuesday’s service observed the full ritual of the Church with holy water from the River Jordan from the private Royal Family font poured on Miss Markle’s head.
The Chapel Royal at St James’s Palace is particularly significant in Harry’s life as well as the history of the Royal Family.
It is where Princess Diana’s body lay for a week before her funeral in 1997 and where King Charles I received the Holy Sacrament before his execution in 1649.
The chapel also hosted Prince George’s christening in 2013.
Among those assisting with the service was the Crown Jeweller Mark Appleby, who brought the silverware used for Royal Family christenings. This included a silver font, basin and flask of holy oil.
In accordance with tradition Miss Markle had two sponsors, the equivalent of godparents, to support her in the baptism.
It is understood one supporter was a close girlfriend.
Miss Markle was following partly in the footsteps of the Duchess of Cambridge, who was baptised as an infant but had a private confirmation after her engagement to Prince William.
The Chapel Royal choir of six Gentlemen-in-Ordinary and ten Children of the Chapel – the oldest continuous musical organisation in the world – performed throughout the service.
It is not thought either Miss Markle’s mother, Doria Ragland, or her father, Thomas Markle, who are divorced, travelled from the US for the service.
However, it is understood there were 18 guests who after the ceremony walked to Clarence House, where Charles and Camilla hosted a dinner.
Miss Markle’s multi-faith upbringing is not uncommon in California where she was born in 1981.
The chapel also hosted Prince George’s christening in 2013. The young royal is pictured arriving for his first day at school at Thomas’s School in Battersea +5
The chapel also hosted Prince George’s christening in 2013. The young royal is pictured arriving for his first day at school at Thomas’s School in Battersea
Her father, a retired Hollywood lighting director, was Episcopalian – the main US offshoot of the Anglican Church – while her mother belonged to another Protestant denomination.
After her parents split, Miss Markle attended the Roman Catholic Immaculate Heart girls’ high school in Los Angeles, although she was not Catholic.
Her first husband Trevor Engelson was Jewish but she did not convert to his faith. The couple met in 2004 and married in 2011 but were divorced two years later.
Church guidelines suggest that Miss Markle may be interviewed about her divorce from Engelson, a film producer.
If such a conversation were to occur, the minister would ask if there had been ‘sufficient healing of the personal and social wounds’ from the divorce.
The Church of England conducted 111,500 baptisms last year, of which 9 per cent were for those aged over 13.
Guidance from one church notes: ‘If you are an adult and want to be baptised and/or confirmed, you must undertake a course of preparation called catechesis.
‘This takes place over several months in order to give you a thorough grounding in knowledge of the Christian faith.’