The consequences for students who leave class to protest school shootings depend a lot on where they live.

Students in Prince William County have been told they will be disciplined for walking out of school without authorization. In Montgomery County, students learned their absences would be unexcused and their grades could be affected. For Arlington County students taking part in protests, the message from the school district was one of understanding, not punishment.

As more students take part in walkouts to protest school shootings and gun laws, Washington-area schools are scrambling to come up with responses that balance respect for students who wish to demonstrate with a need to minimize disruptions to the school day.

The guidance from schools will be needed over the coming months. While walkouts this week have been mostly spontaneous, a nationwide protest is planned for March 14, the one-month anniversary of the shooting that took 17 lives last week at Marjory Stoneman Douglas High School in Parkland, Fla.

A march on Washington scheduled for March 24, a Saturday, won’t affect school days, but another school walkout has been planned for April 20, the 19th anniversary of the shooting at Columbine High School in Colorado, which left 15 dead and became the tragic reference point for subsequent school shootings.

Megan Black and Olivia Mumma decided at 8 a.m. Wednesday to organize a noon walkout at Patriot High School in Prince William County, where they are seniors. They texted and tweeted furiously, hoping that two or three dozen of their fellow students wouldtake part in a 17-minute demonstration — one minute for each victim of last week’s shooting.

When the hour arrived, more than 300 students left their classrooms and listened as Black, standing on a bench in the school’s stadium and holding a megaphone, read the names of the victims and demanded: “We are here to tell America and our representatives that we need gun control now! You cannot tell us that our lives mean less than a 19-year-old’s access to semiautomatic weapons.”

Black and Mumma had been warned that the walkout would disrupt classes and knew they could face punishment — the school district had made that clear.

“I feel like I’d rather take a suspension and be on the right side of history than stay in the classroom and be complicit and not be heard,” Black said. The two said they ultimately weren’t punished for organizing Wednesday’s walkout, but were told they would be if they led another.

The scene at Patriot High was similar to what unfolded at schools across the region Wednesday as thousands of students staged walkouts in Northern Virginia, the District and Maryland to join marches or moments of silence as part of the #NeverAgain movement billowing at high schools and middle schools across the nation.

Faced with student protests unlike any in recent memory, schools worked to manage the moment.

In Prince George’s County, about 300 students at Frederick Douglass High School walked out for 20 to 30 minutes Wednesday, then complied with a request to return to class, spokesman John White said. No disciplinary action was taken, he said, but school officials attempted to contact the parents of any student who left school property.

In Montgomery County, school officials said they were trying to encourage important conversations in the wake of the Florida shooting while endeavoring to keep students on campus. The county’s schools superintendent, Jack Smith, issued a statement Thursday about the walkouts and recent threats to schools.

“While we support student advocacy, leaving school property poses a significant safety risk,” Smith wrote, noting that the district does not have resources to protect students when they are off school grounds.

About 1,300 students from six high schools walked out Wednesday, heading to suburban Metro stations, where they boarded trains and converged near the U.S. Capitol to rally for laws to curb gun violence.

The absences were considered unexcused, district spokesman Derek Turner said. While most would agree with what the students are advocating for, he said, the district wants to be consistent and not have to choose between student causes.

At least three middle schools and a high school in Montgomery County allowed on-campus protests this week that were supported by administrators, he said.

“It’s an important conversation, and we’re very open for kids to have these discussions, have these debates, because they are the generation that this directly affects,” he said.

Not all Montgomery parents were happy with how the rules were applied.

A.J. Campbell has an eighth-grade daughter who walked out of class at Takoma Park Middle School and faces three lunchtime detentions and possible academic penalties for missing class.

“The academic [penalty] is the thing that’s not right,” Campbell said.

In Arlington, where hundreds of students walked out of three high schools and five middle schools to protest, district officials took a different approach.

“We allowed it to happen,” spokeswoman Linda Erdos said. “It’s a sad thing that the kids are grappling with, and we want to be as supportive as possible. Students need to be able to express their feelings, too.”

Erdos said the district will soon release its plans for handling walkouts scheduled for next month and beyond.

In Fairfax County, schools also withheld punishment from students who walked out. According to the district’s guide for student rights and responsibilities, principals have discretion to decide whether students have a legitimate reason to be absent from class, district spokesman John Torre said.

A representative for D.C. Public Schools did not reply to requests for information about its policy for students who walk out to take part in protests.