A growing number of colleges nationwide are scrambling to fill classes, a trend analysts say is driven by a decline in the number of students graduating from high school and widespread concern among families about the price of higher education.

The admissions upheaval at schools ranging from lower-tier colleges to esteemed regional ones, including St. Mary’s College of Maryland, contrasts with the extraordinary demand for the most elite colleges and universities.

Demographics pose a major hurdle for many colleges that market primarily to high school students. The number of new high school graduates peaked in 2011, after 17 years of growth, and is not projected to reach a new high until 2024, according to the Western Interstate Commission for Higher Education. Analysts and educators expect that a rising share of incoming students will need major financial aid.

The economic recovery is also hurting enrollment because fewer people go to college when jobs are available. According to state data released this week, Maryland colleges have 2.8 percent fewer students this fall, the second straight year of decline and the sharpest annual drop in 30 years.

Nationwide, college enrollment fell about 2 percent this past school year.

All of this means a new bottom line for colleges, said Brian T. Prescott, the commission’s director of policy research. “They’ve got to sweat whether or not they’re going to be able to make their classes, in ways they didn’t before,” Prescott said.

For colleges, the uncertainty often means that crucial decisions about how many applicants to admit and how much financial aid to offer are reduced to sheer guesswork. For applicants, it invites a rethinking of their aspirations: In a turbulent market, what exactly is a “safety” school, where admission prospects are strong, and what is a “reach,” where the odds are longer?

Students also could have more leverage if aiming for a school that is not in the top tier, college analyst Edward B. Fiske said. “If you can pay full freight, it’s a buyer’s market,” he said.

The decline in prospective students and the enormous costs associated with running a college create a challenge for schools that rely on tuition to pay the bills. It leaves some colleges vulnerable to major financial shifts if students choose to go elsewhere, and it creates a sometimes urgent need to fill seats for the tuition dollars. Families appear to be more price sensitive than in the past, and they might be in a better position to select among certain kinds of schools based on their cost.

Nowhere is the challenge more visible than at St. Mary’s, a public honors college in Southern Maryland. Two consecutive years of declining freshman enrollment jolted the school, resulting in an abrupt change in leadership, a lower credit rating and a drive to find qualified students. This fall, there are 384 freshmen, the smallest class in 13 years.

Admissions officers who failed to visit key areas of Maryland in the last cycle are now fanning out to all corners of the state. Professors are lunching with prospective students and parents on the tranquil waterfront campus. Tuition discounts will be dangled to more admitted students.

The college’s interim president, Ian Newbould, said St. Mary’s must intensify its outreach. “What we are doing is changing the culture from gatherers to hunters,” he said. “A lot of places kind of followed the ‘build it and they will come’ model. Well, the world’s changed. There’s far more competition.”

For the most prestigious universities, the competition is not much of a problem. Top-tier schools draw many thousands of strong applicants and could fill their classes several times over.

Overall, though, higher education has begun a retrenchment. For many colleges, teenagers with academic mettle and financial means are in short supply.

Loyola University New Orleans and Central College in Iowa, both private, had notable enrollment shortfalls this year. Enrollment plunged at the private Howard University in the District in 2012 but rebounded partially this fall. Moody’s Investors Service has downgraded its credit ratings of Howard, Central and St. Mary’s, among other schools, and warned that colleges face heightened recruiting competition.

With high fixed expenses, few colleges are rolling back prices. Average tuition and fees have soared 27 percent, to $8,893, at public four-year colleges since 2008, and they have risen 14 percent, to $30,094, at private nonprofit schools. Those College Board numbers account for inflation but not discounts offered for financial need or academic merit.

At St. Mary’s, tuition and fees for Maryland residents are $14,865 this year, compared with $9,161 at the public University of Maryland at College Park. St. Mary’s froze in-state tuition this year after years of increases.

Administrators and faculty say a few big mistakes fueled the enrollment meltdown.

The college cut back on small merit awards for admitted students with solid credentials and offered larger scholarships to those with exceptional records. The move backfired. Many targeted students chose more prestigious schools. “We think that really hurt us,” Newbould said.

Matthew Fehrs, an assistant political science professor who is versed in the college’s financial aid and admissions policies, said that in 2012, St. Mary’s offered admitted students about 150 scholarships worth less than $3,000 each. In 2013, he said, it offered about 30 of those.

Small merit awards are sometimes known as “cocktail party scholarships” because they give parents something to brag about with their friends. But they are often deal-clinchers. St. Mary’s officials say they will offer more of them during this cycle.

Another misstep: The admissions team visited fewer Maryland high schools than in years past. Fehrs said recruiters inexplicably bypassed Howard County, one of the state’s top producers of college-bound students.

Also, the college set what in hindsight was an unrealistic enrollment target of 470 freshmen. In the previous decade, St. Mary’s drew an average first-year class of 448. But in 2012, the total fell sharply, to 419. In May, the college’s president, Joseph R. Urgo, disclosed that enrollment was falling far short and that the school would need budget cuts.

Those and other issues led to Urgo’s exit. The college’s Board of Trustees pressured him to leave after his three-year contract ended in June. Newbould, who took over in August, installed a new team of admissions “hunters” whose quarry is not only high school seniors but also community college transfers.

With a picturesque campus on the St. Mary’s River, 70 miles southeast of Washington, the college regularly places among the top 100 liberal arts schools in the annual U.S. News and World Report rankings. Its student-faculty ratio is 11 to 1, lower than at most public colleges and universities.

One morning this month, Bianca Calin, a sophomore from McLean, led two Howard County families on a campus tour. “You’re working with professors one on one, which is nice,” Calin said. “You don’t have a student teaching your class.”

They strolled through the library (iPads and Kindles available for free checkout); the dining hall (“dessert crepes are big here,” Calin said); a dormitory where students can monitor washer/dryer cycles remotely by computer; the recreational center (yes, with a climbing wall); and a boathouse, where students can check out kayaks and other water gear.

At lunchtime, biology professor Robert W. Paul and a colleague ate with two families, fielding questions on study abroad and campus culture. “Cool place,” Paul told them. “Small, friendly. Has lots of faculty-student interaction.”

Rachel Harris, 17, a senior at Poolesville High School in Montgomery County, said afterward that she is also considering American University, the College of William and Mary, Dickinson College and Elon University. St. Mary’s impressed her, she said, especially its “sense of community” and “the vibe you get.”

But she wasn’t done shopping. She joked that her preferences seem to change, depending on where she took her most recent tour.

“Whenever I visit a school,” Harris said, “then it becomes my top choice.”