MEXICO CITY (AP) — Andres Manuel Lopez Obrador took the oath of office Saturday as Mexico's first leftist president in over 70 years, marking a turning point in one of the world's most radical experiments in opening markets and privatization.

In his first speech to Congress, Lopez Obrador pledged "a peaceful and orderly transition, but one that is deep and radical ... because we will end the corruption and impunity that prevent Mexico's rebirth."

Mexico long had a closed, state-dominated economy, but since entering the General Agreement on Trade and Tariffs in 1986, it has signed more free trade agreements than almost any other country, and privatized almost every corner of the economy except oil and electricity.

Now, though, Lopez Obrador talks a talk not heard in Mexico since the 1960s: He wants to build more state-owned oil refineries and encourages Mexicans to "not to buy abroad, but to produce in Mexico what we consume."

Even so, Lopez Obrador has tried to send conciliatory financial markets, which have been roiled in the weeks before he took office.

"I promise, and I'm a man of my word, that the investments of foreign and international investors will be safe, and we will even create conditions that will allow them to get good returns," he said, "because in Mexico there will be honesty, rule of law, clear rules, economic growth and confidence."

But he also harkened back to his hero, ex-president Lazaro Cardenas, who nationalized the oil industry and redistributed land during his 1934-40 administration.

"We are going to govern for everyone, but we are going to give preference to the most impoverished and vulnerable," Lopez Obrador said. "For the good of all, the poor come first.'"

The first foreign dignitaries that Lopez Obrador greeted were U.S. Vice President Mike Pence and Ivanka Trump.

"I want to say that since July 1, the day I was elected, I have received respectful treatment from President Donald Trump", Lopez Obrador said.

But he faces a challenge with a caravan of thousands of Central American migrants camped out on the border, which Trump had threatened to close to keep them out.

Lopez Obrador said he wanted to reach an agreement with the governments and companies in the U.S. and Canada to develop Central America and southern Mexico, so people wouldn't have to migrate — "to address in that way, and not with coercive measures, the migration phenomenon."

That appeared to be an acknowledgment that Mexico is prepared to house migrants waiting to make asylum claims in the United States in exchange for U.S. development aid.

"The only person he (Lopez Obrador) can't afford to get in a fight with is Trump, because he knows he could derail his plan," said author and columnist Raymundo Riva Palacio. "He is willing to do the dirty work for them."

Lopez Obrador was clear in blaming extreme market-oriented policies he calls neoliberalism for Mexico's problems.

"Mexico's crisis originated not only with the failure of the neoliberal policies applied over the last 36 years," he said in his inaugural speech, "but also in the prevalence of the filthiest corruption."

Mexico's richest man, telecom magnate Carlos Slim, appeared to welcome the new president's pledge to rein in wasteful spending and fight corruption, saying: "Everybody wants spending to be efficiently managed."

The rowdiest response from Congress came when Lopez Obrador pledged "not to persecute officials of past administrations," saying "revenge is not my strong suit."

Legislators responded by counting loudly to 43 — the number of students kidnapped and disappeared in September 2014 — to remind Lopez Obrador of his promise to establish a truth commission to find out what happened to the students — a pledge he repeated Saturday.

Prosecutors have said they were kidnapped by corrupt police and turned over to a drug gang that killed them and burned their bodies.

Combined with a deep sense of nationalism and his own place in history, Lopez Obrador's inauguration is the most home-grown, populist handover of power in decades.

As to underscore the transition, British Labour Party leaders Jeremy Corbyn showed up for inauguration after visiting Lopez Obrador a day earlier at his house in southern Mexico.

"At a time when the fake populists of the far right are gaining ground internationally — including in Latin America," according to a Labour Party statement issued in London, Lopez Obrador "has shown that a progressive agenda for change can win power and take on the status quo."

Lopez Obrador pledged to personally oversee daily 6:00 a.m. security briefings to confront the rising tide of violence in Mexico, and pledged to ban both oil and gas fracking and genetically modified crops.

Lopez Obrador will hold another ceremony later in the day on Mexico City's main square, where a leader of Mexico's indigenous communities will bestow a traditional symbol of authority — a ceremonial wooden staff. A grand celebration featuring traditional music will be held in the square.

The country's 65-year-old new leader is moving the presidential office fully back to the centuries-old National Palace that lines one side of the square, while refusing to live at the luxurious, heavily guard presidential residence 6 miles (9 kilometers) to the west. He will reside instead at his private home.

Closed to the public since the first parts were built in the 1930s, the compound will now be used for public events and it was thrown open to the public on Saturday.

Gabriela Barrientos, 71, a retired secretary and Jesus Basilio, a market vendor, 55, were among the first to line up at the gate to enter what Basilio called "the house of the people, an emblematic place we will be able to enter for the first time."

Yaneth Fierro, 42, a housewife from Acapulco, expressed amazement at the luxury of the compound — there was a small cinema in the basement of one building — but disappointment at completely emptied rooms. "We wanted to see the furniture, but the "Gaviota" (the nickname of former first lady Angelica Rivera) took them all."

The handover of power began at midnight when new cabinet secretaries were sworn in for key security posts — a tradition meant to ensure there's always someone at the helm of the Army, Navy and Interior Department, the country's top domestic security agency.

New Interior Secretary Olga Sanchez Cordero said in a post-midnight ceremony that the new government will "listen to everybody, the majority and the minorities, because in a democracy all opinions can be expressed."

Lopez Obrador gained prominence as a leftist politician leading protests against oil pollution in his swampy native state of Tabasco, though he hasn't given any indication that he will cancel private oil exploration contracts or pull out of Mexico's free trade agreements with 44 countries.

Lopez Obrador won a crushing victory in the July 1 elections after two previous, unsuccessful runs for the presidency and he is the country's first president since the Mexican Revolution to rise to prominence as a protest leader. He sees his inauguration as a historic "fourth transformation" of Mexico, following independence from Spain, the liberal reforms that broke the church's dominance in the 1850s and the 1910-1917 revolution.

Lopez Obrador's predecessor, Enrique Pena Nieto, leaves office with a historically low approval rating, which in several polls ranged from 20 percent to 24 percent. Pena Nieto failed to rein in Mexico's rising homicide rate or deal with thousands of Central American migrants camped out on the border, leaving both intractable issues as the biggest immediate challenges facing Lopez Obrador.

___

Associated Press writers Mark Stevenson and Amy Guthrie contributed to this report.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.