WASHINGTON — A top US senator is warning the Obama administration's plans for Afghanistan could lead to a repeat of the instability and violence that has plagued Iraq.

Since President Barack Obama and senior Iraqi leaders failed to reach an agreement that would have allowed American military troops to remain there beyond 2011, political chaos and ethnic violence created an environment the Islamic State has exploited.

After a visit last week to Afghanistan, Obama's 2008 general election foe says that country could be headed down a similar path.

"No one should mistake the administration's declared end of combat operations in Afghanistan with an end of our mission there," incoming Senate Armed Services Committee Chairman John McCain, R-Ariz., said in a statement. "The truth is, this work remains unfinished. Indeed, steady reports of Taliban offensives are a painful reminder of that fact."

The 2008 GOP presidential nominee is urging Obama to "give the thousands of US forces that will remain in the country beyond this year the authorities they need to train, advise, and assist our Afghan partners in finishing the mission that we undertook together after the attacks of Sept. 11, 2001."

He also charged the White House with carrying out a "calendar-driven drawdown of US forces," saying it should replace it "with a plan based on conditions on the ground."

"If this is not done, and if the administration insists on pulling all US forces out of the country for political reasons, Afghanistan will deteriorate just as Iraq has since 2011," McCain said. "That would not just be a tragedy for the Afghan people; it would put the American people in far greater danger."

In a recent piece penned for Defense News , Army Gen. John Campbell, commander of NATO's International Security Assistance Force (ISAF), lauded the ability of Afghan forces to continue leading the fight against the Taliban.

"The Afghan National Security Forces (ANSF) demonstrated their professionalism and capability, fighting tenaciously against a determined enemy, and preventing the Taliban from achieving any of its stated objectives for 2014," Campbell wrote. "As a result, the ANSF have earned the Afghan people's trust and admiration and are now the most respected institution in the country.

"The ANSF have shown throughout the past two fighting seasons that they can win battles on their own," Campbell wrote. "They now need our assistance to win the campaign and build the institutional capability to organize, train and equip their forces. Hence, we have shifted our focus from advising them on tactical operations to building the long-term sustainability in their corps and security ministries."