After enrollment in Baltimore public schools unexpectedly dropped following years of growth, officials are bracing for nearly $30 million in funding cuts and investigating whether hundreds of students were mistakenly kept on the rolls.

City schools chief executive Gregory Thornton said he launched the internal investigation into student rolls after he noticed discrepancies between attendance data and what he saw when he visited schools. He said he expected to find overcrowded classrooms — a common complaint from teachers — but often did not.

“It didn’t add up,” Thornton said, noting that students were on the rolls but weren’t present. “Maybe they were just luckily absent that day, but it got to the point of having to have conversations about data integrity, because we can’t build this organization on false numbers. They’ve got to be real.”

Among some educators in city schools, the phenomenon has a name: “ghost students.”

State funding for Baltimore public schools would decline by about $25 million under Gov. Larry Hogan’s proposed budget because of the drop in student population and other factors, including a formula that measures an area’s wealth. City funding is expected to decline as much as $4 million in per-pupil funding.

District officials said they discovered “irregularities” and the extent of the problem — about 1,900 pupil slots will no longer be funded by taxpayers — when they took the annual student count Sept. 30. The district is required to report that number to the Maryland State Department of Education to help determine budgeting.

Although fewer students were enrolled in Baltimore schools, officials also believe mistakes were made. For instance, they said teachers might not have taken attendance consistently. The number of students could have been incorrect because the city’s computerized attendance program automatically defaults to “present,” and teachers must manually note absences.

Principals also could have made mistakes when confirming student rosters before sending them to the central office, district officials said. They must determine whether students meet attendance and age requirements — and other criteria — to qualify for state and city funding.

School officials are still investigating why the student count was wrong — and for how long.

Union leaders representing teachers and principals said it is the district’s responsibility to ensure that student rolls are correct when reported to the state. They also noted that educators have felt pressure from the central office to keep enrollment up — even if that meant keeping students on rosters when they were not attending school regularly.

The issue could have huge implications for one of the state’s largest school districts, which has nearly 85,000 students in kindergarten through 12th grade and a $1.2 billion budget. The district has had years of budget problems, including an unforeseen deficit of $60 million that grew to $100 million last year, forcing the first layoffs in more than a decade.

The budget cuts “will drastically impact a number of activities we’re actively pursuing, not the least of which is the 21st-century plan,” said Marnell Cooper, chairman of the city school board, referring to a $1 billion plan to consolidate, renovate and rebuild schools.

Still, Cooper cast the discovery of the enrollment problem as the result of improved accountability in the district. He noted that the school closure and renovation plan is aimed at making the district more efficient by creating an infrastructure that matches enrollment and student needs.

“I can confirm that Dr. Thornton and his team found discrepancies, but as a result, our processes are better,” he said. “I get [that] the initial shock will be painful, but at the same time, we are really trying to right-size this district.”

Thornton, who has been CEO since July 2014, said that when district officials began closely examining the rolls last spring, they determined that about 230 students should have been withdrawn for that school year but were still being counted and funded.

When students returned in the fall, district officials began a more thorough review of the rolls. Each school district must count the number of students who meet funding criteria every year.

For instance, district officials said they found 864 students who did not meet the state’s attendance requirement last fall, compared with 114 the year before. Among the criteria, students must be present one day in September and one day in October without 10 consecutive unexcused absences.

District officials also said they did not heed red flags. Hundreds of city students on the rolls had no grades or standardized test scores recorded for them, according to Theresa Jones, chief achievement and accountability officer. She said those students should have been flagged and removed from the list earlier.

“There were protocols that may have been in place that weren’t followed through,” she said.

Some teachers have referred in recent years to “ghost students” being on their rosters. District officials said they had not heard the term but continue to investigate.

Thornton declined to be more specific about what he called “irregularities” that officials found in past practices.