Kabul, Afghanistan (CNN) - U.S. Defense Secretary Robert Gates, citing some headway in Afghanistan, arrived in the war-torn country on Thursday to consult with political and military officials.
He will be meeting on Thursday with Afghan President Hamid Karzai and Gen. David Petraeus, who leads U.S. and NATO-led forces in Afghanistan. The trip comes ahead of Afghan parliamentary elections later this month.
His trip comes a day after he visited Iraq, where he attended a change of command ceremony that marked the end of the U.S. combat mission there.
In remarks on Tuesday at the annual convention of the American Legion, Gates tied the two conflicts together, saying that "with the invasion of Iraq, our attention - and our resources - were diverted."
"Afghanistan became a second-tier priority for troops, equipment, and security and development assistance. Starting in 2003, the Taliban re-grouped, refilled their ranks, re-constituted themselves in safe-havens, and re-entered Afghanistan. Violence began to increase significantly in 2005 and has grown worse ever since," he said at the Milwaukee, Wisconsin conference.
He reiterated President Barack Obama's point that more resources can be allocated to Afghanistan now that the Iraq conflict is winding down.
"Today, for the first time in nine years, we now have the resources - the troops and equipment, military and civilian - needed for this fight," Gates said and the "full complement of surge forces" is only now being reached.
"The total international military commitment, when fully deployed, will reach approximately 150,000 - more than three times the number when I became defense secretary going on four years ago - including some 45,000 troops from our NATO allies and other partners. This dramatic increase in military capability is amplified by a tripling of deployed civilians and a substantial influx of trainers."
Gates said there is "slow but steady headway" in helping Afghans assume security responsibility.
"General Petraeus has worked with President Karzai to develop a plan for locally recruited forces that will be accountable to the central government, but will also give local communities the means to defend themselves," he said.
He stressed that the beginning of a transition to Afghan control in July doesn't mean a swift withdrawal and said troops will be proactive in attacking the Taliban after that time.
"As in Iraq, our drawdown will be gradual and conditions-based, accompanied by a build-up of military assistance and civilian development efforts," he said. "If the Taliban really believe that America is heading for the exits next summer in large numbers, they will be deeply disappointed and surprised to find us very much in the fight."
Gates said more than 350 Taliban commanders have been slain or captured the past three months as troops try to oust them from their enclaves and take hold of "key population centers."
This year has been the deadliest for U.S. troops in the Afghan war, and Gates said "it will a tough, hard campaign, with setbacks and heartbreak."
"The fact that we knew that our losses would increase as the fight was brought to the enemy makes them no easier to bear. The intensifying combat and rising casualties is in many ways reminiscent of the early months of the Iraq surge, when our troops were taking the highest losses of the war," he said.
He said skepticism over Afghanistan mirrors that about Iraq a few years ago.
"Back then, this country's civilian and military leadership chose the path we believed had the best chance of achieving our national security objectives - as we are doing in Afghanistan today. Success there is not inevitable. But with the right strategy and the willingness to see it through, it is possible. And it is certainly worth the fight."
He also told the veterans that it was a "mistake 20 years ago" to abandon Afghanistan "after the Soviets were driven out." The Taliban came to power during the "power vacuum" and harbored the al Qaeda terror network that launched attacks around the world.
"As events have shown in New York, Washington D.C., Pennsylvania, London, Madrid, Amman, Lahore, Bali, Jakarta, and elsewhere around the world - we were wrong," Gates said.