Washington (CNN) -- Citing the challenges in Afghanistan, President Barack Obama and visiting British Prime Minister David Cameron said Wednesday they remained committed to completing the mission successfully by turning over security responsibility to Afghan forces by the end of 2014.
In a White House news conference after two hours of talks, the two leaders noted the difficulties faced by the U.S.-led NATO forces, including the alleged massacre Sunday of 16 Afghan civilians by a lone U.S. soldier.
With calls increasing to speed the withdrawal from Afghanistan, Obama and Cameron made clear they intend to stick to the timetable set by NATO to complete the handover of security responsibility to Afghan security forces in less than three years.
Obama provided more detail than he has previously, saying a summit of NATO leaders in May in Chicago will "determine the next phase of transition," including "shifting to a support role next year in 2013 in advance of Afghans' taking full responsibility for security in 2014."
"We're going to complete this mission, and we're going to do it responsibly, and NATO will maintain an enduring commitment so that Afghanistan never again becomes a haven for al Qaeda to attack our countries," the president said.
Both Obama and Cameron referred to the difficulties of recent days, a clear reference to the civilian killings in Kandahar province that brought threats of retaliation from the Taliban and a demand for justice from President Hamid Karzai's government.
"We will not give up on this mission, because Afghanistan must never again be a safe haven for al Qaeda to launch attacks against us," Cameron said. Noting that "we won't build a perfect Afghanistan," he said the goal is to "ensure that Afghanistan is capable of delivering its own security without the need for large numbers of foreign troops."
"As the president said, in 2013, this includes shifting to a support role as Afghans take the lead," Cameron said. "This is in advance of Afghan forces' taking full responsibility for security in 2014. And as we've always said, we won't be in a combat role after 2014."
The statements made clear that some kind of foreign presence will continue after 2014, as is being negotiated by the U.S. and Afghan governments in talks on a possible strategic partnership.
"There will be a robust coalition presence inside of Afghanistan during this fighting season to make sure that the Taliban understand that they're not going to be able to regain momentum," Obama said. "After the fighting season, in conjunction with all our allies, we will continue to look at how do we effectuate this transition in a way that doesn't result in a steep cliff at the end of 2014, but rather is a gradual pace that accommodates the developing capacities of the Afghan national security forces."
Wednesday's talks also covered efforts to end the strife in Syria and prevent Iran from getting a nuclear weapon. Obama and Cameron presented a united front on both issues, with Obama warning Iran that "the window for solving this issue diplomatically is shrinking."
Israel has made clear it could launch a military strike on Iran's nuclear facilities, and the Obama administration is pushing for Prime Minister Benjamin Netanyahu to allow more time for diplomatic efforts, including international sanctions and negotiations.
"Those sanctions are going to begin to bite even harder this summer, and we're seeing significant effects on the Iranian economy," Obama said, later adding that he "sent a message very directly to them publicly that they need to seize this opportunity of negotiations ... to avert even worse consequences for Iran in the future."
On Syria, the two leaders pointed out that the situation is more complicated than the one in Libya, in which NATO air power helped subdue government forces fighting an uprising that eventually toppled longtime leader Moammar Gadhafi.
Asked if planning was under way for possible implementation of a no-fly zone, as occurred in Libya, Cameron said the focus for now was on "trying to achieve transition, not trying to foment revolution."
"We think that the fastest way to end the killing, which is what we all want to see, is for (Syrian President Bashar al-Assad) to go," Cameron said. "So the way we should try to help bring that about is through diplomatic pressure, sanctions pressure, political pressure, the pressure that (U.N.-Arab League envoy) Kofi Annan can bring to bear. That is where our focus is."
He and Obama both acknowledged other options were under study as part of general contingency planning but indicated no imminent move toward military action.
"Our military plans for everything. That's part of what they do," Obama said, adding that a concern is not to make the situation in Syria worse through unintended consequences.
"When we see what's happening on television, you know, our natural instinct is to act," Obama said. "One of the things that I think both of us have learned in every one of these crises, including in Libya, is that it's very important for us to make sure that we have thought through all of our actions before we take those steps."
Ultimately, he said, the goal is a "more peaceful transition" in Syria rather than civil war, adding that those most affected by such decisions "are the people in Syria itself."
After the news conference, Cameron headed to a White House lunch with dignitaries, including Vice President Joe Biden, Secretary of State Hillary Clinton, Supreme Court Justice Stephen Breyer and some members of Congress.
He also was the guest of honor at a state dinner Wednesday night where the main course on the menu was Bison Wellington, which the White House called "a perfect pairing" of U.S. and British cultures with a classic English dish -- the Wellington -- getting an "American twist with the use of buffalo tenderloin."
In a toast beginning the dinner, Obama praised Cameron's leadership.
"In good times and in bad he's just the kind of partner that you want at your side. I trust him. He says what he does and he does what he says," Obama said.
Cameron praised Obama's "strength, moral authority and wisdom," adding, "the president says what he will do and he sticks to it."
Earlier, Obama and Cameron joked with each other before their meeting about British lingo and how the British targeted the White House in the War of 1812.
"We Americans and Brits speak the same language most of the time," Obama said in welcoming Cameron on the second day of his Washington visit. "So let me just say, David, we are chuffed to bits that you are here. I am looking forward to a great natter. I am confident that together we are going to keep the relationship between our two great nations absolutely top-notch."
Cameron responded that Obama's spectacular command of British vernacular and the display of British flags made him feel at home.
"I am a little embarrassed that 200 years ago my ancestors tried to burn this place down," Cameron said, laughing. "Now, looking around me I can see that you've got the place a little better defended today. You are clearly not taking any risks with the Brits this time."
Cameron's U.S. trip is intended to demonstrate that ties between the countries remain as close as ever. On Tuesday, Obama gave a nod to America's heartland in a halftime interview during an opening game of the NCAA basketball tournament in Dayton, Ohio, that he attended with his guest.
The president and Cameron flew together on Air Force One for the game between Western Kentucky and Mississippi Valley State.
Obama said he wanted to show the British leader a part of America rarely seen by foreign visitors.
"I thought it was going to be wonderful for the prime minister to have a chance not only to see a basketball game for the first time, but also to come to the great state of Ohio, because sometimes when we have foreign visitors, they only see the coasts, they go to New York, they go to Washington, they go to Los Angeles, but you know, the heartland is what it's all about," Obama said.
Obama's choice of venue may not have been coincidence, as he faces re-election in November and Ohio is historically a key swing state.
The White House labeled Cameron's visit an official one, rather than a state visit. That's because the label of state visit is reserved for heads of state, and Cameron is the head of government. Queen Elizabeth II is the head of state.
However, the White House called Wednesday night's event a state dinner, the sixth so far of the Obama administration.
"The fact that we are hosting the prime minister in the manner that we are demonstrates the nature of the relationship between our two countries; the fact that it is a special relationship," White House press secretary Jay Carney told reporters this week.
Cameron and his wife, Samantha, will leave Washington on Thursday.
CNN's Stacia Deshishku and Lateef Mungin contributed to this report.