At the height of the Great Famine in the 1840s, as tens of thousands of Irish immigrants poured into Boston, the Rev. John McElroy embarked on a dream to establish a Jesuit college where sons of Irish immigrants could ­receive a Catholic education.

McElroy, pastor of St. Mary’s Church in the North End, faced fierce anti-Catholic sentiment. But he persisted, and in 1863 obtained a charter for a new school in the South End. As “pious revenge” for the city’s resistance, he named it Boston College.

On Saturday, the college kicks off a wide-ranging 150th anniversary celebration with a Mass at Fenway Park that is expected to draw some 20,000 people.

The Rev. William P. Leahy, the university’s president, will celebrate the Mass, and Cardinal Sean P. O’Malley will preside. Boston College High School, which is also marking the 150th anniversary of its founding, will also take part. A reception and tour of the park will follow.

In all, the celebration will ­extend over three semesters and feature a series of speakers and academic conferences and a gathering of college presidents to discuss issues facing Catholic higher education.

BC students will be asked to perform 150 minutes of volunteer community service over the period, and athletes will wear a sesquicentennial logo on their uniforms this season.

BC said it will ­invite the US president to ­address the university on its Founders Day next April, as President Kennedy did at BC’s 100th anniversary in 1963. Kennedy noted that BC was founded “in the darkest days of the Civil War” and that the world was still faced with the “great question of whether this world will be half slave and half free or all free.”

Kennedy opened with a quip about his distinctive way of speaking. “It is a great pleasure to come back to a city where my accent is considered normal,” he said.

In an interview, Leahy said the 150th anniversary is an occasion to be grateful for the “gifts and blessings” BC has enjoyed and an “invitation” to reflect on how the school began and how far it has come. He said that McElroy and the other Jesuits who helped found BC were men of faith and focus, committed to starting the school despite oppo­sition.

“They saw the need for education,” he said. “They were relent­less.”

When BC finally opened, ­demand was light. As the college officially launched in September 1864, days after the fall of Atlanta, just 22 young men showed up.

The first dean, the Rev. Robert Fulton, was scarcely ­impressed with the new crop.

‘’

“Many came gratuitously, and only one or two had talent,” he wrote, according to a survey of the college’s first 150 years written by Thomas O’Connor, the university historian who died in May.

But the Jesuits believed in their mission, and the college slowly grew. For second-generation Irish, whose parents ­arrived in this country with ­almost nothing, the college was a springboard to a better life. Tuition was just $60 a year in its early days, compared with the $150 a year charged by Holy Cross, the school’s Jesuit predecessor.

“For the average immigrant family, [$150] might just as well have been $1 million,” O’Toole said.

By the turn of the century, the college had outgrown its South End campus, and turned its eye to its modern-day home, what college president the Rev. Thomas Gasson called the “magnificent site on Commonwealth Avenue toward Brighton,” O’Connor wrote.

The first building opened in 1913, ushering in BC’s modern era. But geography was not the only motivation. In the 1890s, Harvard University announced its law school would no longer accept BC graduates, saying they were not qualified, sparking a cross-river spat.

BC vigorously defended its academic rigor, and Harvard ulti­mately backed down. But BC came to realize that Harvard had a point.

“BC’s pride is hurt in all of this,” O’Toole said. “People recognize that the academic program has to change.”

During World War I, how­ever, enrollment plummeted from 671 in fall 1916 to 125 two years later. If the conflict had persisted for even another year, the college may have closed, O’Connor noted.

BC experienced another precipitous decline during World War II, with enrollment falling from more than 1,200 in 1941 to 236 in 1944. After the war, as veterans took advantage of the GI Bill, the college thrived, and in the years that followed added a range of graduate and doctoral programs.

Yet by the late 1960s, the universithy was again in dire straits, a commuter-school that was losing wealthier Catholics to more prestigious institutions. In 1973, BC had suffered five years of major deficits and was on the brink of bankruptcy, O’Connor’s history noted.

“It was more than possible the place would simply fold,” O’Toole said.

But instead of hunkering down to stabilize its finances, BC chose to raise its sights, a bold gamble that gradually transformed it into a national university.

Jack Connors, a longtime trustee who graduated from BC in 1963, recalled picking up four other students on his drive to campus, a far cry from ­today’s residential experience.

“You went to class, you went to work, you went home,” he ­recalled.

Connors said he is amazed how far the college has come since its 100th anniversary, when the school “wasn’t even on the charts in terms of ­national profile.”

Last year, more than 34,000 students applied to be undergraduates.

Leahy said BC will seek to build on its strengths and hopes to increase fund-raising to broaden its ambitions.

But he said the university will remain mindful of what got it this far.

“It’s a chance to dream and reach into the future,” he said. “But our future has to be shaped by our past and present.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.