NATO has had a rough time over the past year.

Before taking office, President Trump was an outspoken critic both on the campaign trail and as president-elect, dubbing the defense alliance "obsolete" and suggested he would reconsider U.S. support. (Last month during a White House meeting with NATO Secretary General Jens Stoltenberg, Trump backed off those statements, saying: "I said it was obsolete; it's no longer obsolete.")

Trump isn't alone in expressing skepticism about the alliance: Marine Le Pen, the French far-right firebrand who finished second in last month's presidential elections, said she would pull her country out of NATO during her campaign.

These internal frictions come as the organization faces renewed antagonism from Moscow and continuing issues in Afghanistan and elsewhere. But as Trump heads to Brussels to attend a meeting of NATO leaders, there's some bright news on the horizon: A new poll shows that support for NATO appears to have actually risen over the past year — on both sides of the Atlantic.

The poll, conducted by Pew Research Center as part of its annual Spring 2017 Global Attitudes Survey, showed a considerable gain in favorable views of NATO in all seven countries surveyed.

That figure included both the United States, where support surged from 53 percent to 62 percent between 2016 and 2017, and France, where support rose from 49 percent to 60 percent in the same period. On average, more than 6 of 10 viewed the organization favorably. Spain was the only country where less than half the country had a favorable view of NATO. Positive views were highest in the Netherlands and Poland, which were both found to have 69 percent favorability.

Such statistics may be met with a sigh in relief with Brussels, where Trump's comments last year caused widespread consternation about the future role of the alliance's most powerful member. While the U.S. president has since walked back his harshest criticisms of NATO, for some American allies, questions remain about his intentions and sometimes even his basic understanding of the organization.

Pew's poll did find that there was a large divide between Democrats and Republicans when it came to NATO, with 78 percent of Democrats having a favorable view of NATO and just 47 percent of Republicans expressing the same. Favorable views of NATO have surged dramatically among Democrats over the past year, jumping 20 points, while Republicans have dropped five but are still higher than their lowest point measured (39 percent in 2013).

These partisan splits aren't necessarily unusual — smaller, though still notable, splits exist in Spain, Sweden, France and Germany, though in those cases left of center parties tend to have a lower favorable view of NATO than their right-wing peers.

Even with all the concern about Trump, most NATO allies remain confident that the United States would come to their defense if there was a serious military conflict with Russia — with those in Spain (70 percent), Canada (68 percent) and Britain (66 percent) the most positive in their responses. For their part, 62 percent of Americans said that if Russia got into a military conflict with a neighboring country that is a NATO ally, they should use military force to defend the country and only 31 percent disagreeing.

Not all countries would do the same in these circumstances. 53 percent of Germans said they would not aid a neighbor militarily if they were attacked by Russia, making it the only country where opposition to military force in these circumstances was larger than support. Spain was split on the issue, while Britain was only narrowly in favor of military action. This reluctance to commit militarily could prove to be a problem in the future — in fact it speaks to the criticisms made by Trump about partners not pulling their weight.

But for now, NATO still seems to be an attractive proposition for members, and also for some nonmembers too: 47 percent of Swedes were found to want NATO membership, while 39 percent opposed and 14 percent unsure.

Pew's surveys were conducted using face-to-face and telephone interviews conducted in early 2017 and compared to previous years going back to 2009. A more detailed methodology can be seen here.

More on WorldViews: