It was the fall of 2008, and Liberty University suddenly found itself dealing with a problem it had never before encountered in its more than 40-year history:

College Democrats.

The largest evangelical Christian university in the world, whose doctrinal statement at the time declared its “strong commitment to political conservatism, total rejection of socialism and firm support for America’s economic system of free enterprise,” had never had a chapter of the student organization on its campus.

For a while, the newly formed group went about its business as College Dems at any other school would. They held meetings and drank too much coffee and campaigned aggressively for Barack Obama.

But the following spring, the club’s leadership received an e-mail from the vice president of student affairs: “I must inform you that the College Democrats club is no longer going to be recognized as a Liberty University club,” it read. “We are unable to lend support to a club whose parent organization stands against the moral principles held by Liberty University.”

Citing problematic aspects of the Democrats’ platform — support for federal funding of abortion and hate crime legislation, promotion of the “LGBT agenda,” “socialism,” etc. — the e-mail said that association with the party ran contrary to Liberty’s values. The students were ordered to stop referencing the school in the group’s name and promotional materials and informed that their club would be removed from the school’s Web site.

Six years later, David Nasser, Liberty’s senior vice president for spiritual development, set about booking guest speakers for the school’s “convocations,” the semiweekly school assemblies that evolved from chapel services. He reached out to the expected list of people: Christian musician David Crowder, Rep. Louie Gohmert (R-Tex.), Heritage Foundation president and former senator Jim DeMint.

Also on the list? Sen. Bernie Sanders (Vt.), a Jewish, self-styled “Democratic socialist” who voted against the Defense of Marriage Act, defends Planned Parenthood and has called for a downward “transfer” of wealth from the top 1 percent to the middle class.

Sen. Bernie Sanders, challenging Clinton for 2016 bid

COLUMBIA, SOUTH CAROLINA - SEPTEMBER 12: Vermont Senator Bernie Sanders (I-VT) speaks to mostly African American voters and students at Benedict College in Columbia, South Carolina on Saturday September 12, 2015. (Melina Mara/The Washington Post)

Nasser asked, Sanders accepted, and when the convocation schedule was announced Wednesday, the whole world (or at least the political press) asked, “Why?

It’s obvious why Sanders would want to speak at Liberty: He’s running for president. Speaking to large and sometimes skeptical audiences is what presidential candidates do. And Sanders, who’ll be speaking from the most left-leaning end of the political spectrum, probably has more trouble reaching audiences like Liberty’s than almost anyone else.

“It is very easy for a candidate to speak to people who hold the same views,” Sanders said Wednesday in comments relayed by a spokesman. “It’s harder but important to reach out to others who look at the world differently.”

What’s less clear is why Liberty, a school that has made its name as a pilgrimage site for the country’s top conservatives, would offer him their soapbox. These convocations aren’t just any old school assembly — they’re mandatory for all students who live on campus. That means at least 8,000 of Liberty’s students, most of them impressionable freshmen and sophomores, will be required to spend half an hour listening to a man much of whose platform the school has explicitly and implicitly condemned.

The explanation is simpler than it seems. Like Sanders, the school has something to prove.

Liberty was founded in 1971 by the Rev. Jerry Falwell, a televangelist and icon of the religious right. Originally just a small Baptist seminary in the foothills of Lynchburg, Va., by 1984 it had become a fully accredited university, part of a religious empire that included Falwell’s Thomas Road Baptist megachurch, the Moral Majority lobbying group and the “Old Time Gospel Hour,” his syndicated radio and TV ministry.

“It’s our goal,” Falwell said of the school in 1985, “to be the Harvard of academics, the Notre Dame of athletics and the Brigham Young of religious schools to evangelical and fundamentalist girls and boys.”

The rules in the early days were restrictive. Interracial dating was briefly banned (by 1985 it was allowed, but the school would call both students’ parents to make sure they were all right with it), as were jeans, drugs and gatherings of members of the opposite sex in any unlit part of campus. Demonstrations weren’t allowed unless approved by the administration. Twice weekly attendance at Thomas Road Baptist Church services was absolutely mandatory. And every student and staff member was required to sign a statement agreeing to abide by the school’s doctrinal views, which covered topics both religious and political.

Those rules appealed to some students — “Christians are supposed to be different,” 18-year-old Michelle Brown, a freshman in 1985, told The Washington Post at the time — but they were often at odds with Falwell’s ambitions for expansion. In 1993, the school agreed to drop many of its most stringent religious requirements in order to keep receiving state tuition assistance grants.

And despite its intense conservatism, the school was unusually open to hearing opposing viewpoints. Falwell routinely invited Sen. Ted Kennedy (D-Mass.) to speak on campus. Kennedy gave a famous speech on religious tolerance at a convocation more than 40 years ago.

An even bigger transition happened after Falwell’s death in 2007.

By that point, the student body had grown to nearly 10,000, but the school was also $30 million in debt. Falwell’s son and successor as chancellor, Jerry Falwell Jr., had a revised vision: transforming Liberty from a relatively niche religious school into a mega-university. In less than 10 years, Falwell Jr. has made the school the largest private nonprofit university in the country, with $1.2 billion in reserves that rivals the endowments of many much older institutions. That influx of cash has been powered by the school’s more than 100,000 on-campus and online students — 10 times the enrollment of only a decade before.

But expansion, for many reasons, has required a slight easing of the rules. For one thing, there was only a limited number of 18-year-olds whose idea of a great college experience was one where no movies rated higher than G were shown (now they’re allowed to watch anything below R). The new tens of thousands of students who attend are no longer required to agree to Liberty’s doctrinal statement, though they are expected to commit to a Christian way of life.

“We’re not the Moral Majority anymore,” Falwell Jr. told The Post in 2013. “We’re not a church. Our mission is to educate.”

There are financial and legal reasons for inclusivity as well. Liberty’s nonprofit status and its accreditation depend on carefully managing its religious and political affiliations.

In the 1980s, the school’s biology program was initially denied accreditation because it included a course called “The History of Life,” which taught creationism. Eventually the class was moved to the humanities department, though students are still taught the biblical view alongside the science of evolution.

After the dust-up about College Democrats on campus in 2009, the watchdog group Americans United for Separation of Church and State filed a complaint with the Internal Revenue Service challenging the school’s status as a nonprofit.

“If the school insists on pushing policies that favor Republicans over Democrats, it should have to surrender its tax exemption,” executive director Barry W. Lynn argued.

Liberty responded by removing official recognition from its College Republicans as well, a move that won praise from Virginia’s Democratic governor at the time, Tim Kaine.

Sen. Ted Cruz (R-Tex.) announced his intention to run for president in the 2016 election during a speech at Liberty University in Lynchburg, Va. (AP)

The school unquestionably remains a hub of fervent religious and political conservatism. The student code of conduct is explicit about its goal of helping students become “more Christ-like.” It bans gambling, “horseplay” and attendance at a dance. Larger infractions — having an abortion, possession of alcohol, involvement with witchcraft and premarital sex, along with more traditional crimes such as assault and theft — are punishable by administrative withdrawal.

And Liberty has become a near-mandatory stop on the campaign route for conservative candidates. Of the 17 major candidates running for the Republican nomination, more than half have visited the school at some point. Sen. Ted Cruz (R-Tex.) announced his campaign at a convocation there in May.

But until this year, no major Democratic candidate has spoken at Liberty. President Obama, Vice President Joe Biden and former secretary of state Hillary Rodham Clinton have all been asked — another requirement for nonprofit status is that an invitation must be extended to all candidates for a political seat if one is invited — but each declined.

Which brings things back to Bernie Sanders.

Speaking to The Post by phone on Thursday, Falwell Jr. said that Liberty had decided to reach out to the senator last spring, even before Cruz came to the school to declare his candidacy. Sanders was selected specifically to dispel the notion that Liberty only invited conservative speakers.

“We’ve always believed that our convocation should be a forum for different views, a time to ask questions and learn,” Falwell said.

“A university is supposed to be a place where all ideas are discussed,” he continued. “That’s what we’re doing.”

Just as Sanders hopes to bolster his candidacy by speaking to an audience from way across the aisle, Liberty sought to affirm its legitimacy by inviting him. Having a Jewish quasi-socialist speak at the school is a way of fighting the perception that the school is just an echo chamber for conservative Christian politics.

And, Falwell Jr. said, other “liberal” schools could learn a thing or two from a purportedly closed, conservative campus like Liberty’s. When former secretary of state Condoleezza Rice was invited to speak at Rutgers University’s commencement last spring, students and faculty protested for weeks until she voluntarily backed out. Falwell says he’s seen no such response to the Sanders invite from Liberty’s own student body.

“You have to hear from people who believe something different from you,” he said, the only slightest hint of smugness in his voice. “That’s why you go to college.”