DAYTON, Ohio -- About six years ago, some branches of the U.S. military struggled to attract recruits because of the strong economy and concerns about fighting the war in Iraq.

But the military today is having an easier time meeting manpower goals because of the economic slump, strong retention rates and the conclusion of the mission in Iraq, officials said.

The war officially ended Dec. 15.

Branches of the military continue to meet or exceed accession goals, and the quality of applicants is improving, according to recruiters and analysts.

''If anything, the quality of the kid we are putting in is (better), especially in the last couple of years," said recruiter and Master Sgt. Jason Wilson, with the 338th Recruiting Squadron at Wright-Patterson Air Force Base.

''The flow to the recruiting office has greatly increased, whether it be a direct reflection of the economy or the war on terror."

After the terrorist attacks of Sept. 11, 2001, recruiters saw a spike in interest to serve in the Air Force, said Wilson, an operations flight chief.

''After 9/11, we got flooded," he said. "Patriotism was never more on the forefront. We had a lot more kids and young adults wanting to serve their country, more than I have ever seen."

But 10 years later, after long conflicts in Iraq and Afghanistan and the economic downturn, the motivations for serving changed for some people.

Patriotism vs. jobs

Patriotism has remained for at least nine years one of the top three reasons recruits cite when asked why they joined the U.S. Air Force, according to surveys by the military. Another top motivation has been to continue a college education.

But in the last three fiscal years, the third most commonly cited reason for enlisting in the Air Force was job security.

Even people who enlist for patriotic reasons say that this is an especially convenient time to serve given the state of the job market.

''With the economy the way it is, it's nice to have job security," said Airman 1st Class Samuel Benner of the 28th Operational Weather Squadron at Shaw Air Force Base in Sumter, S.C.

Benner, 21, said he joined the Air Force in 2009 because of a strong desire to serve his country.

Still, he said the pay and benefits are good and the Air Force is paying for him to attend college online to improve his skills.

''They are giving me tuition assistance," he said. "I plan to do 20 years in the Air Force and then retire."

The Air Force has met its active-duty recruiting goals for 12 straight years. The goals are set by the Pentagon.

The active-duty Air Force enlisted 28,526 people in fiscal 2011, exceeding its goal of 28,515, according to military data.

In fiscal 2010, the Air Force needed 28,360 accessions, and it enlisted 28,493 people.

The year before, the Air Force enlisted 31,983 people, when it needed 31,980.

But the Air Force is only one segment of the armed forces, and its recruiting successes are not reflective of the entire military.

The Army recruits more active-duty and Reserve troops than the other services combined. It has consistently struggled to meet recruiting goals because only one in four people 17 to 24 years old is eligible to join without a waiver, said Kathleen Welker, spokeswoman for the U.S. Army Recruiting Command headquartered in Fort Knox, Ky.

To join without a waiver, recruits cannot have felony criminal records, must have completed high school, cannot have certain medical conditions and must meet physical fitness requirements, she said.

In 2005, when the economy was robust and the country lacked a clear exit strategy for Iraq, the Army missed its active-duty recruiting goal of 80,000 people by 6,745, according to the military.

But troop withdrawals in the Middle East and America's economic conditions have helped make the military an attractive career choice for those lured by job security and benefits. The Army is no longer missing its monthly and annual recruiting goals, and it is meeting its quality benchmarks, too.

''The recession coupled with the positive view of the military has created a good recruiting climate," said Donald Herth, the public affairs officer for the Army's Columbus Recruiting Battalion.

Seeking more qualified soldiers

Herth said the Army is recruiting more people with college degrees, and the Army's reduced need for troops because of de-escalation in the Middle East is improving the caliber of recruits.

In fiscal 2011, 98.6 percent of the Army's recruits were high school graduates, the highest percentage since 1992, according to military recruiters.

In fiscal 2007, only 79 percent had a high school degree. The Army's goal is 90 percent or better.

The "military has become very choosy about who it takes," said Jonathan Winkler, associate professor of history at Wright State University. "They won't take just anyone, and the days of the high school dropout joining the service are long gone."

The economy has been challenging for young people, and military pay is typically higher than civilian jobs held by people of comparable age and education, said Beth Asch, senior economist and defense-manpower specialist with the RAND Corp., a nonprofit research organization in Santa Monica, Calif.

Additionally, she said, college endowments have declined, and students have less financial aid available, and the military is attracting students who need help paying for school and who desire training to build their job skills.

''There was a dramatic increase in educational benefits with the new, Post-9/11 G.I. Bill," Asch said. "The military has become much more financially lucrative, relative to the civilian sector."

Samantha Block, 30, said she joined the Air Force ROTC while attending Michigan Technological University in Houghton, and she was commissioned after graduating in 2003.

Block, who works as a program manager for a military contractor, said she joined the Air Force because tuition was rising and scholarships were not going to cover the cost of school.

The military paid for her last two years of college, and she said enlisting was her best career decision.

''I couldn't have gotten a better jump start to a career," said Block, who had been stationed in Japan. "I had five job offers before I got out of the military."

Block said patriotism and a sense of duty will always compel people to enlist, but economic conditions and foreign wars also matter.

''It's more likely that during wartime, the new recruits will be patriotic-driven," she said. "During less of a (time of conflict), new recruits will be driven by other forces."