Students go about their business at the University of California, Los Angeles, a four-year institution, on May 28, 2009. Getty Images

Americans rate the education quality at community colleges and four-year colleges about the same. A recent Gallup poll found that 66 percent of respondents said they thought community colleges' teaching was "good" or "excellent," compared to 70 percent who said the same for four-year colleges and universities. Only Internet-based college programs lagged behind, at 36 percent.

"Though it may be harder to gain acceptance into and afford four-year colleges and universities, Americans view the quality of education they provide as no better than that of community colleges," Gallup wrote in its results, which were released Tuesday.

Community college has been in the news recently, with several Democratic politicians promoting it as a path to the middle class. In January, President Barack Obama put forth a proposal that would give two tuition-free years of community college to anyone willing to work for it, and 2016 candidate Hillary Clinton has supported his idea. Senators Elizabeth Warren, D-Mass., and Bernie Sanders, I-Vt., have also promoted debt-free college, indicating that access to higher education could be a big issue in the upcoming election.

But enrollment in community colleges has fallen in recent years, decreasing 6 percent from 2013 to 2014, according to U.S. News and World Report. They're also notoriously underfunded and have low graduation rates: Roughly one-fifth of full-time community college students get a degree within three years.

In the Gallup poll, public opinion varied with respondents' ages. People 65 and older had the best opinion of community colleges, with 71 percent saying the education was "good" or "excellent," while only 58 percent of 18- to 29-year-olds said the same. The trend was flipped when they were asked about four-year schools -- young people held traditional colleges and universities in higher esteem than the elderly did.

Internet-based college programs were less popular across the board. Thirty- to 49-year-olds had the best opinion of them, with 39 percent saying they were "good" or "excellent" options. People 65 and older were the least kind, with 32 percent saying they offered a quality education. Respondents have previously told Gallup they doubted the online programs' grading, instruction and value in employers' eyes.

Though the poll did not ask about them specifically, the results came as the Obama administration got another victory in its effort to regulate for-profit colleges. On Tuesday, a federal court upheld regulations from the Education Department that threatened for-profits' funding if they didn't provide evidence their students made enough money after graduation to pay off their loans. Coupled with the recent shutdown of the for-profit network Corinthian Colleges Inc., it was seen as another step toward holding schools accountable for their graduates' success, the Chicago Tribune reported.

The Gallup poll included answers from about 1,500 people between June 2 and 7. See the full results here.