This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

MADRID (AP) — The heir to the Spanish throne, Princess Leonor, swore allegiance to her country’s Constitution on her 18th birthday Tuesday, laying the groundwork for her eventual succession as queen when the time comes.

The nationally televised ceremony in the lower house of parliament is understood to symbolize the continuity of Spain’s parliamentary monarchy and the institution’s allegiance to the chamber.

Leonor de Borbón Ortiz recited the same oath as her father did when he — then prince — turned 18 in 1986. She pledged “to faithfully carry out my duties, to keep and uphold the Constitution and the laws and respect the rights of citizens and the autonomous communities and loyalty to the king.”

The ceremony was necessary for her to be able to succeed to the crown and someday become queen.

Leonor became crown princess when Felipe VI was proclaimed king on June 19, 2014. Her photo has appeared frequently in the media lately along with the term “Leonormania,” underlining her growing popularity as the modern face of the future monarchy.

“From here forward, my duty is to all Spaniards, who I will serve in each moment with respect and loyalty,” Leonor said in a short speech at the Royal Palace after the ceremony in parliament’s Congress of Deputies.

“I ask you to place your trust in me, just as I have all my confidence placed in the future of our nation,” she said.

Banners with her photograph decorated lampposts along several of Madrid’s main streets. Many official buildings were festooned with drapes and tapestries for the ceremony, which was broadcast on several giant screens set up in Madrid.

The royal family — Leonor, younger sister Sofia, Felipe and Queen Letizia — arrived at the parliament building escorted by a mounted squadron of Spain’s Royal Guard. Leonor and Sofia waived from inside a Rolls-Royce to the crowds lining the streets in the center of the capital.

Representatives from leftist political parties, including three government ministers, and lawmakers from Basque, Catalan and Galician regional and separatists parties boycotted the event as they favor a republic, not a monarchy.

But the parliamentary chamber was packed with lawmakers and dignitaries, including former prime ministers, and the royal family received a prolonged applause after Leonor took her oath.

The royal family is still trying to recover its former good name in Spanish society and make up for the scandals involving several family members, most notably former King Juan Carlos, Leonor’s grandfather.

Neither Juan Carlos nor former Queen Sofía attended Tuesday’s public events, but they were to be present at an evening family gathering in the Pardo Palace outside Madrid.

Juan Carlos, 85, who abdicated in 2014, left Spain for Abu Dhabi, the United Arab Emirates, in 2020 amid a cloud of financial scandals. Investigations of his finances in Spain and Switzerland have since been dropped while he won a separate lawsuit, against a former lover, in October.

He has made it known that he would like to return Spain but it’s not clear whether Felipe or the government would agree to that just yet.

Felipe and Letizia, have recovered a lot of the institution’s good image but for many in Spain the monarchy is still questioned, given that it was former dictator Gen. Francisco Franco who put Juan Carlos on the throne, bypassing his father and natural heir, Juan de Borbón.

Spain had not had a royal family since Alfonso XIII went into exile with the coming of the Second Republic in 1931, five years before Franco and other generals staged a coup.

The royal family’s popularity today is difficult to gauge. Spain’s main polling body stopped asking Spaniards what they think of the royals in 2015 amid the myriad scandals.

Leonor has been groomed by her father and mother, who before marrying Felipe was a television journalist. The princess has shown regal aplomb when presiding over the awards ceremony of the Princess of Asturias Foundation and other honorific institutions that she heads.

She is currently receiving basic military training at an academy in the northeastern city of Zaragoza. She speaks English, French, Catalan, a language spoken in northeastern Spain, and some Arabic.

Little is known about Leonor’s personality as she has yet to give media interviews. But when she received her high school graduation diploma in Wales earlier this year, her fellow students cheered her on and her tutor praised her “unwavering passion for learning, for understanding people, and exploring diverse perspectives,” adding that they would miss her sense of humor.

____

Associated Press writer Joseph Wilson in Barcelona, Spain contributed to this report.