Thousands of mourners dressed in black lined the streets of Bangkok on Saturday as the body of Princess Bajrakitiyabha, King Maha Vajiralongkorn's eldest daughter, was brought to the Grand Palace.

The princess, known as Princess Bha, died on Thursday at age 47 from an abdominal infection. She'd spent more than three years in a coma after a cardiac condition.

"When it comes to saying goodbye, it's not easy for us," said Donnapha Kladbupha, a 54-year-old English teacher and self-described royalist.

The procession stretched 10 kilometres from Chulalongkorn Hospital to the Grand Palace. Police closed roads as the royal motorcade passed, led by the king and Queen Suthida.

Thai public broadcaster Thai PBS reported that the princess's body was carried in the same vehicle that transported the body of her grandfather, King Bhumibol, who died in October 2016.

Mourners sat in sweltering heat along the route. Many were older. Some queued to pour holy water into a ceremonial bowl placed before a portrait of the princess — a Buddhist ritual.

"I'm sad that she passed away, especially when I saw her pictures as a child," said Nitikan Tephakham, 79, from the northeastern province of Roi Et. "When she was sick, I prayed for sacred beings to protect her and hoped for a miracle."

After the procession, Buddhist rites were chanted inside the palace behind closed doors. Live footage showed monks chanting before the king and queen, seated on gilded chairs with a portrait of the princess behind them.

The government hasn't announced funeral details yet. But it's ordered state officials to wear black and flags to fly at half-mast for 15 days.

Security was tight. Attendants wore formal attire, media access was restricted, and dozens of police stood guard.

Tourists at the palace grounds, one of Bangkok's most popular attractions, had to find workarounds. Maria Marcais, a 22-year-old visitor from Canada, said, "It's something quite unique that someone can be this much loved. It's profound."

This is the second death in the royal family in months. Queen Sirikit, the king's mother, died in October at age 93.

Bajrakitiyabha was the only child of Vajiralongkorn's marriage to Princess Soamsawali. She was a trained prosecutor and diplomat, educated in Britain, Thailand, and the United States, and served as ambassador to Austria.

The 73-year-old king has seven children from four marriages. He hasn't announced his chosen heir, though succession rules favour men.

Strict lese-majeste laws protect the Thai royal family from criticism. Violations carry prison sentences of up to 15 years per charge.