For the first time in more than a quarter-century, a majority of Mexicans hold negative views of the United States, according to polling data collected by the Mexico-based firm Buendia & Laredo in collaboration with the Chicago Council of Global Affairs and the Woodrow Wilson International Center for Scholars that will be released Thursday.

The data suggests a dramatic turnaround in Mexican opinions about the country's northern neighbor in the last couple of years. In 2015, the Pew Research Center found that 66 percent of Mexicans held favorable views of the United States, while only 29 percent had unfavorable views.

Two years later, those views had almost exactly flipped: 65 percent of Mexicans held unfavorable views of the United States in fall 2017, while only 30 percent held favorable views. Unsurprisingly, this shift coincided with the beginning of President Trump's term in early 2017.

Trump has been a frequent and vocal critic of Mexico on matters related to immigration, crime and trade. When Trump announced he would seek the presidency in June 2015, he accused Mexico of sending drugs and rapists across the border and later made his promise to "build the wall" along the border with Mexico a cornerstone of his immigration policy.

Similar rhetoric has followed Trump into office — in a private conversation with Mexican President Enrique Peña Nieto in January, Trump warned of potential tariffs on Mexican goods and said that the Mexican leader should stop saying publicly that his country would not pay for a border wall as the U.S. president had promised it would.

This language may not have influenced American views of Mexico. December 2017 survey data from the Chicago Council found Americans gave Mexico a rating of 51 out of 100, where 0 is very unfavorable and 100 is very favorable, similar to ratings in both 2014 and 2016 but up from a low of 43 in 2013

But Trump's harsh words for Mexico do appear to have influenced what Mexicans think of America. Chicago Council polling, conducted by the Mexico City-based Buendia & Laredo in late September and early October, found that among the 85 percent of Mexicans who said they knew of Trump or had heard of him, 89 percent had a negative opinion.

The Chicago Council's findings in Mexico echo recent polling by Pew, which found last year that 93 percent of Mexicans said they had “not too much confidence” or “no confidence” in the U.S. president to do the right thing in global affairs — a dramatic rise from just 45 percent who said the same in 2015 during President Barack Obama's second term.

At the same time, other surveys  suggest that Mexicans make a distinction between Americans and their leader: A December 2017 poll by Parametria found that 46 percent of Mexicans had favorable views of Americans, while 45 percent held unfavorable views.

Despite the negative views of Trump and the United States, there were signs of shared interests for Mexicans and Americans. According to Chicago Council data, both nations shared positive views of the benefits of international trade for consumers: 78 percent of Americans held these views, compared with 69 percent of Mexicans. At least a small majority in both nations — 51 percent of Mexicans and 64 percent of Americans — said globalization had a positive effect on their home country.

With the North American Free Trade Agreement a major bone of contention for the Trump administration and negotiations about the deal ongoing, a majority of Mexicans (62 percent) and Americans (53 percent) saw the agreement as good for their nations' economies — a relatively stable number over recent years.

However, 75 percent of Mexicans said they thought the United States is an unfair trader, compared with just 46 percent of Americans who said the same of Mexico.

In both countries, there is a strong feeling that the two are moving in different directions on a number of issues. A majority in both nations believe they are diverging in their policy on combating illegal drug trafficking (59 percent of Americans and 51 percent of Mexicans) and securing the border (62 percent of Americans and 76 percent of Mexicans).

Some 49 percent of Americans feel the two nations are working in different directions on trade and economic development, compared with 74 percent in Mexico, where 58 percent also said the two were going the opposite way in the battle against organized crime in the country, a question that was not asked in the U.S. survey.

Other international polls have shown that Mexico is not the only nation to lose faith in the United States since the election of Trump. The previously mentioned poll by Pew found that in the vast majority of 37 countries surveyed, favorable views of the United States had dropped after the end of the Obama presidency.

However, the effects may be keenly felt in Mexico, a U.S. neighbor and a key stakeholder in a number of domestic issues important to Americans. Mexico is scheduled to hold a general election July 1, and one populist candidate, Andrés Manuel López Obrador, is finding a receptive audience by marketing himself as an anti-establishment — and anti-American — choice.

After decades of integration with its northern neighbor, however, many Mexicans no longer want a closer alliance with Trump's America. According to a January 2017 poll by Parametria, 55 percent of Mexicans want to seek a closer relationship with Latin American countries rather than close ties with the United States.

Buendia & Laredo conducted their poll between Sept. 30 and Oct. 7, 2017, via in-person interviews with a nationwide random sample of registered Mexican voters. The margin of error is plus or minus 3.5 percentage points.

Most respondents from the United States were interviewed by GfK Custom Research using a nationwide online research panel between June 27 and July 19, 2017, with a national sample of 2,020 adults over 18 who lived in all 50 states plus the District of Columbia, with a margin of error of plus or minus 2.4 percentage points.

More on WorldViews