WASHINGTON — President Obama said Tuesday that the United States would formally recognize a coalition of Syrian opposition groups as that country’s legitimate representative, in an attempt to intensify the pressure on President Bashar al-Assad to give up his nearly two-year bloody struggle to stay in power.

Mr. Obama’s announcement, in an interview with Barbara Walters of ABC News on the eve of a meeting in Morocco of the Syrian opposition leaders and their supporters, was widely expected.

But it marks a new phase of American engagement in a bitter conflict that has claimed at least 40,000 lives, threatened to destabilize the broader Middle East and defied all outside attempts to end it. The United States had for much of the civil war largely sat on the sidelines, only recently moving more energetically as it appeared the opposition fighters were beginning to gain momentum — and radical Islamists were playing a growing role.

Experts and many Syrians, including rebels, say the move may well be too little, too late. They note that it is not at all clear if this group will be able to coalesce into a viable leadership, if it has any influence over the fighters waging war with the government or if it can roll back widespread anger at the United States.