California schools prevented students who had not been vaccinated for whooping cough from going to school on Thursday and told them not to come back until they had the required shot, the San Francisco Chronicle reported.

Students from seventh to twelfth grades are required to be vaccinated for the illness, according to a new state law.

High school and middle school students in San Francisco were told to either get appropriate paperwork from their doctors or go to the school district's central office on Thursday, where they could get free vaccines, the San Francisco Chronicle reported.

In addition to offering shots at the central office, individual schools were providing shots on Friday, The Associated Press reported. 

The San Francisco Unified School District says that approximately 2,000 students have not been vaccinated for whooping cough, The AP reported.

We're getting down to it, spokesperson Heidi Anderson said, The AP reported.

Some schools in the northern part of the state are ignoring the vaccination rule, which requires that students from seventh to twelfth grades get vaccinated for whooping cough, The Sacramento Bee reported.