Two years after winning an election in which foreign policy was barely mentioned, President Obama is being pummeled at home and abroad for his international leadership. The world sometimes seems as if it is flying apart, with Mr. Obama unable to fix it. Through a combination of a few significant missteps, circumstances beyond his control, unreasonable expectations and his maddeningly bland demeanor, Mr. Obama has opened himself to criticism that he is not articulating a strong, overarching blueprint for the exercise of American power and has not been able to bend authoritarian leaders to his will.

It is paradoxical that, in key respects, Mr. Obama is precisely the kind of foreign policy president most Americans and their allies overseas wanted. He rejected the shoot-first tendencies of George W. Bush, who pretended to have all the answers, bungled two wars and asserted an in-your-face American exceptionalism that included bullying allies. We know where that got us.

But Mr. Obama has long been fully responsible for his own foreign policy. While he has made mistakes, and can be frustratingly cautious, he has done a better job than his detractors allow, starting with salvaging an economy that is at the core of American power. He has produced the first possibility of a deal on Iran’s nuclear weapons. Even though shrinking budgets and a public that is tired of war and unconvinced of the need for international engagement have undoubtedly put a check on his ambitions, talk of America shrinking from the world is overblown.

Still, too often, Mr. Obama’s ambitions seem in question. It does not feel as if he is exercising sufficient American leadership and power, even if he is in fact working to solve a problem. Some analysts have suggested he lacks a passion for foreign policy. Others say he has no inspiring ideological prism through which the world can understand his choices. Others say he is too resigned to the obstacles that prevent the United States from being able to control world events as easily as it may once have done. These criticisms have some truth to them, and Mr. Obama sometimes makes things worse when he deigns to explain himself.

By last week, when he was in the Philippines defensively talking about his inability to affect outcomes in places like Syria, Egypt and Israel, he offered a sadly pinched view of the powers of his office. “You hit singles, you hit doubles; every once in a while we may be able to hit a home run,” Mr. Obama said. You don’t inspire a team to go out and bloop a single over an infielder. American presidents who stood as strong global leaders did so by setting high expectations in clear, if sometimes overly simplistic, ways. Mr. Obama’s comments last week fanned the anger of people on the left and the right who find him unfocused, weak and passive.

What follows is an examination of some of the world’s problems, the areas where Mr. Obama has done well, and the areas where he has stumbled.

THE TRANSFORMATION TRAP Mr. Obama positioned himself as a transformational leader, but in foreign affairs, as in domestic policy, he overestimated the degree to which the mere fact of his election could achieve that transformation. He has run up against the realities of a chaotic and increasingly multipolar world. As a senator running for president in 2008, Mr. Obama spoke of a “new strategy for a new world” that focused on nuclear disarmament and ending the wars in Iraq and Afghanistan, but also promised the United States is “ready to lead again.” When he won his premature Nobel Peace Prize in 2009, Mr. Obama explained his belief in just wars, including those waged on humanitarian grounds.

It is tempting to dismiss criticism from right-wing Republicans like Senator Ted Cruz, who knows little about foreign policy; from Senator John McCain, who knows quite a lot but advocates a military response to almost every crisis; and from former Bush officials. They have an interest in seeing this president fail. It was disquieting to hear some Republicans speak almost admiringly about Vladimir Putin’s macho boldness when the Russian president invaded Crimea. There was a time when both political parties saw real value in cooperating to advance America’s security interests, and the country was better for it.

But there is also powerful criticism from Democrats, liberals and centrists, who fault Mr. Obama’s handling of Syria (some want airstrikes, some want more weapons for rebels) and Ukraine (many want weapons for the government). His critics are inconsistent in their philosophies and have failed to offer cogent alternatives to Mr. Obama’s policies. But the perception — of weakness, dithering, inaction, there are many names for it — has indisputably had a negative effect on Mr. Obama’s global standing.

RED LINES Mr. Obama has been right to avoid direct military involvement in Syria, even though the horrors there — more than 150,000 killed, President Bashar al-Assad of Syria denying aid to starving people, the rise of jihadi groups — have worsened. But he bungled the Assad government’s chemical weapons attack against civilians last year (vowing there was a “red line” and then allowing it to be crossed), and that has left doubts about his willingness to use force in other circumstances.

Mr. Obama made the right choice when he went for a diplomatic solution, under which Syria’s chemical arms stockpile is being dismantled. But did he learn that no president should threaten military action and make a public case for it unless he plans to follow through? America has provided the most humanitarian aid to beleaguered Syrians and led the push for a diplomatic solution to the war. That failed in large measure because Russia and Iran are enabling Mr. Assad. Now, according to news reports, the administration has begun to provide certain rebels with more lethal weapons; the shipments should be monitored and halted if there is evidence of diversion.

USE OF FORCE Mr. Obama has delivered on his promise to end the American-led war in Iraq and is withdrawing troops from Afghanistan, although too slowly. He has committed to pursue diplomacy first and war as a last resort, but he is no pacifist. Mr. Obama joined France and Britain in military strikes to aid rebels in ousting Col. Muammar el-Qaddafi of Libya, authorized the killing of Osama bin Laden and — to a degree that is far too excessive — shifted military actions to the shadows by authorizing drone campaigns in Pakistan, Yemen and Somalia.

He has asserted the right to order the killing even of Americans who plot against this country abroad. In Asia on April 24, he gave assurances that America’s treaty commitments to Japan included defending islands disputed with China. Accusations that he is soft on terrorism are simply without merit. In fact, his policies are too similar to his predecessor’s for our comfort.

RUSSIA AND UKRAINE When he came to office, Mr. Obama was right to pursue a better relationship with Russia. He has not acted precipitously since Mr. Putin displayed his true colors by invading Crimea and destabilizing eastern Ukraine. Instead, he gave Mr. Putin a diplomatic option that would allow him to back down and then, when Putin did not take it, imposed sanctions on Russians and Ukrainians connected to the turmoil.

Suggestions from the right that Mr. Obama should somehow use the military, or at least the threat of it, against Russia over Ukraine are irresponsible, to put it politely. Mr. Obama’s efforts to work with Europe on tougher sanctions have the best chance of restraining Russia.

But that takes time, and the Europeans, entwined economically with Russia, are balking at adding new sanctions, even as Mr. Putin gobbles up more of Ukraine. A lot is riding on Mr. Obama’s ability to lead the trans-Atlantic response, which includes strengthening Ukraine politically and economically, reasserting international law, and forcing Russia to reconsider its campaign to turn Ukraine into a failed, partitioned state. Mr. Obama has rejected arming the Ukrainians but has beefed up military assets in nearby NATO member countries. He should consider unilaterally imposing more sanctions if the Europeans continue temporizing.

IRAN’S NUCLEAR AMBITION One of Mr. Obama’s most promising initiatives is working with other major powers on a deal to ensure Iran does not build nuclear weapons. An interim agreement, reached last November, has decreased Iran’s ability to produce a weapon quickly, and a final deal is expected by the end of July. While that is anything but guaranteed, Mr. Obama deserves credit for taking the risk of engaging with Iran, and for persuading Congress to hold off on actions that could threaten the negotiations. Now he has to deal with members of Congress who say they want to stop Iran from becoming a nuclear power but do everything they can to stymie any agreement.

THE ASIAN PUZZLE With his recent trip to Asia , Mr. Obama breathed new life into his commitment to focus more of America’s attention on the world’s most economically dynamic region. The trip produced a military base agreement with the Philippines, improved relations with Malaysia, and, officials say, progress during talks in Japan on a 12-nation trade deal. That will be crucial to making his Asia rebalance policy a success and demonstrating that it involves more than a military hedge against China. One country to which he should pay far more attention is India.

ISRAEL AND THE PALESTINIANS Mr. Obama showed leadership in empowering Secretary of State John Kerry to undertake a nine-month negotiation on an Israeli-Palestinian peace deal after fumbling badly with his first peacemaking overture in 2009. The second effort, which seemed better prepared, is now in tatters and seems unlikely to be revived soon. But it demonstrated a serious American commitment and was still worth it, especially if it results in a set of American principles that point the way to a peace deal if the two sides ever muster the will to agree on one.

THE ARAB TURMOIL More than anything else, perhaps, the revolutions in this region have demonstrated the limits of American influence when countries are in turmoil. Egypt is the most important and difficult case. While it is an example of the realpolitik that some of his critics say Mr. Obama lacks, Egypt is Exhibit A in the case against his claim to be supporting democracy in the Middle East. The Obama administration finds itself defending and continuing to finance a repressive military government in Cairo that comes nowhere near to fulfilling the promise of the Arab Spring and that recently ordered more than 1,000 political prisoners put to death.

Taken as a whole and stripped as much as possible of ideological blinkers, Mr. Obama’s record on foreign policy is not as bad as his critics say. It’s just not good enough.