President Biden said Tuesday that the United States was on track to end its two-decade-long military involvement in Afghanistan by his Aug. 31 deadline.

But Mr. Biden, speaking at the White House, said he had spoken to military leaders so they would be prepared to “adjust that timetable, should that become necessary.”

U.S. forces are still working around the clock to evacuate Americans and some of their Afghan allies from Kabul, the capital.

“It is a tenuous situation,” he said.

Mr. Biden gave reporters a barrage of figures about the accelerating evacuation effort at the Kabul airport, saying 70,700 people had been airlifted out so far.

“We are currently on pace to finish by August the 31st,” he said. “The sooner we can finish the better. Each day of operations brings added risk to our troops.”

But he said much of the success of that effort hinged on the Taliban continuing to cooperate with the operation and allowing access to the airport. He said the legitimacy of the Taliban government in the eyes of the United States and its allies depends on the approach it now takes to uphold its international obligations, including ensuring Afghanistan does not once again become a base for international terrorism.

Earlier in the day, the president met virtually with leaders of the Group of 7 nations. Jen Psaki, the White House press secretary, said in a statement that Mr. Biden had told his counterparts: “Our mission in Kabul will end based on the achievement of our objectives. He confirmed we are currently on pace to finish by Aug. 31.”