CHICAGO, IL - APRIL 24: Former U.S. President Barack Obama visits with youth leaders at the University of Chicago to help promote community organizing on April 24, 2017 in Chicago, Illinois. The visit marks Obama's first formal public appearance since leaving office. (Photo by Scott Olson/Getty Images)

KABUL, Afghanistan -- President Barack Obama made a surprise visit to Afghanistan on Tuesday, the eve of the one-year anniversary of the assassination of Osama bin Laden.

The goal of the trip is to meet with Afghan President Hamid Karzai and sign off on a long-term agreement that would extend America's military presence in the country into the next decade. ABC reported that Obama will deliver a live, televised address from Bagram Air Base at 7:30 p.m. EDT. The speech is expected to last for about 10 minutes, a White House pool report notes.

Obama's itinerary was cloaked in secrecy through the day Tuesday, as White House officials sought to keep news of the trip under wraps out of concern for his safety. Even after hints of the president's arrival broke on Twitter and local Afghan news outlets, White House and U.S. embassy officials repeatedly denied that the president was "in Kabul," and reportedly even asked some outlets to remove mention of it from their Twitter feeds.

Kabul has been generally safe recently, but the Taliban has occasionally staged dramatic attacks on international forces and diplomatic installations, including a major assault on the American embassy last year, and a 20-hour siege of the Parliament and other government offices just last month.

Obama left at Washington, D.C. at 12:09 a.m. Tuesday morning, according to the pool report. He was greeted by Ambassador Ryan Crocker and Lt. General Mike Scaparrotti, Deputy Commander of U.S. Forces in Afghanistan.

Obama is expected to sign off on a ten-year strategic partnership agreement while in Afghanistan that has been the subject of protracted negotiations over the past several months. U.S. officials in Kabul say the agreement, the details of which have not yet been released, includes broad terms for American troops to stay in Afghanistan for 10 years after the end of 2014, the deadline for combat operations to end.

Final specifics of the pact, including how much money the U.S. would contribute to Afghanistan's coffers or how many troops would remain in the country, are expected to be negotiated in future memorandums of understanding in the coming year. Analysts have estimated the number of U.S. troops serving as trainers and advisers in the long term could be as high as 20,000.

Senate Armed Services Committee Chairman Carl Levin (D-Mich.) is among those traveling with the president. His staff tweeted Tuesday that the senator is "honored to be in Kabul w/President Obama to witness signing of historic partnership with Afghanistan." Sen. Jack Reed (D-R.I.) also tweeted that he is in Kabul for the signing.

The formal signing of the strategic agreement is seen as something of a perfunctory event -- it was understood that it would be finalized before a major international conference of donors to Afghanistan, which is scheduled for late May in Chicago. But until the initialing of the agreement last week, it was not clear that even a preliminary deal could be reached, as the relationship between Karzai and the Obama administration has grown increasingly frosty over the years.

In that sense, Obama's decision to appear in person in Kabul, and with Karzai, could be seen as marking a significant development in the relationship between the two leaders.

The president's arrival on the one-year anniversary of U.S. special forces killing bin Laden in neighboring Pakistan also marks an important symbolic gesture, one that could resonate as the presidential election season ramps up back home.

UPDATE: 4:00 p.m. -- Obama and Karzai signed the agreement setting the terms for U.S-Afghanistan relations after U.S. troop withdrawal in 2014, the Associated Press reported.