WASHINGTON — With their destination and mission among America’s closest guarded secrets, the small group of officials hand-picked by President Barack Obama boarded a military plane in March.

The travel plans of the U.S. diplomats and foreign policy advisers were not on any public itineraries. No reception greeted them as they landed. But awaiting the Americans in the remote and ancient Gulf sultanate of Oman was the reason for all the secrecy: a delegation of Iranians ready to meet them.

It was at this first high-level gathering at a secure location in the Omani capital of Muscat, famous for its souk filled with frankincense and myrrh, that the Obama administration began laying the groundwork for this weekend’s historic nuclear pact between world powers and Iran, The Associated Press has learned.

Even America’s closest allies were kept in the dark. Obama first shared the existence of the secret diplomacy with Israeli Prime Minister Benjamin Netanyahu in September, and only then offered a limited recounting of how long the discussions between Iran and the United States had been taking place.

The Obama administration then informed the other five nations negotiating alongside the U.S. — Britain, China, France, Germany and Russia. And since then much of their public diplomacy with Iran has focused on incorporating and formalizing the progress made in the private U.S.-Iranian talks.

The AP has learned that at least five secret meetings have occurred between top Obama administration and Iranian officials since March.

Deputy Secretary of State William Burns and Jake Sullivan, Vice President Joe Biden’s top foreign policy adviser, led each U.S. delegation. At the most recent face-to-face talks, they were joined by chief U.S. nuclear negotiator Wendy Sherman.

It was at the final get-together that the two sides ultimately agreed on the contours of the pact signed before dawn Sunday by the so-called P5+1 group of nations and Iran, three senior administration officials told the AP.

All officials spoke on condition of anonymity because they weren’t authorized to be quoted by name talking about the sensitive diplomacy.

The AP was tipped to the first U.S.-Iranian meeting in March shortly after it occurred, but the White House and State Department disputed elements of the account and the AP could not confirm the meeting.

The AP learned of further indications of secret diplomacy in the fall and pressed the White House and other officials further.

As the Geneva talks appeared to be reaching their conclusion, senior administration officials confirmed to the AP the details of the extensive outreach. They spoke only on condition of anonymity because they were not authorized to discuss by name the secret talks.

The Geneva deal provides Iran with about $7 billion in relief from international sanctions in exchange for Iranian curbs on uranium enrichment and other nuclear activity.

All parties pledged to work toward a final accord next year that would remove remaining suspicions in the West that Tehran is trying to assemble an atomic weapons arsenal.

Iran insists its nuclear interest is only in peaceful energy production and medical research. The U.S. and Israel have regularly threatened military action if they believe Iran is about to develop a nuclear weapon.

While the agreement early Sunday — late Saturday in Washington — was concluded to great fanfare and global attention, with Secretary of State John Kerry joining fellow foreign ministers in signing the deal and Obama then presenting it to the nation in a televised White House address, the path there couldn’t have been more secret.

Expectations were kept low for the initial U.S.-Iranian discussions. The officials skirted the big issues and focused primarily on the logistics for setting up higher-level talks. For the U.S., the big question was whether Iran’s leaders would be willing to secretly negotiate matters of substance with a country they call the “Great Satan.”

The private talks were also a gamble for the United States, which cut off diplomatic ties with Iran in 1979 after the Islamic Revolution and the taking of 52 American hostages held for 444 days after rebels stormed the U.S. Embassy in Tehran. To this day the State Department considers Iran the biggest state supporter of terrorism in the world.

The secrecy of Obama’s effort may explain some of the tensions between the U.S. and France, which earlier this month balked at the proposed accord, and with Israel, which is furious about the agreement and has angrily denounced the diplomatic outreach to Tehran.

Burns and Sullivan continued their efforts behind the scenes at this month’s larger formal negotiations between world powers and Iran in Geneva, though the State Department went to great lengths to conceal their involvement.

Their names were left off of the official delegation list. They were housed at a different hotel than the rest of the U.S. delegation, used back entrances to come and go from meeting venues and were whisked into negotiating sessions from service elevators or unused corridors only after photographers left.

Congress hasn’t been notified in detail about the secret diplomacy. That could also pose a challenge for Obama, who has been waging a tense battle with Republicans and Democrats alike to prevent them from enacting new sanctions against Iran at the same time he has been offering Tehran some relief.

Several lawmakers from both parties openly scoffed Sunday at the terms of the deal between world powers and Iran.

And in a reflection of the primary role played by his administration, some already are referring to the end result as Obama’s agreement. None said they had been briefed on the secret talks.

“I don’t know how to react,” Sen. Bob Corker, the Senate Foreign Relations Committee’s top Republican, said on “Fox News Sunday.” “The administration has been trying to set the framework for these discussions for some time and I guess I’m not really particularly shocked that this has occurred.”