As the shooting began, the teenagers captured the sound of gunfire on their phones. When it didn’t stop, they texted their parents and took to social media to share each fearful moment with the outside world.

Then it was over and 17 people were dead. Within a day, as they continued to express their thoughts online and on-air to reporters, the survivors’ expressions of grief turned to calls for political action.

“Blood is being spilled on the floors of American classrooms, and that is not acceptable,” ­David Hogg, a senior at Marjory Stoneman Douglas High School in Parkland, Fla., said Thursday in an interview.

“By working through bipartisanship and working through our differences . . . we can make an actual change. And who knows? Maybe we could save some children’s lives.”

In the familiar aftermath of America’s latest mass shooting, something new stood out: This time, the kids who survived the rampage on Wednesday were demanding to know why the adults who run the country had not done more to prevent it.

The comments came in an outpouring that began Wednesday and had not stopped by Thursday night. On Snapchat, Twitter and Facebook, they remembered peers and teachers and struggled with the emotion of the moment. Many students were interviewed on national TV, some for much of the day.

The pleas for action from Parkland struck a sharp contrast with the almost nonexistent ­debate on Capitol Hill over ­preventing gun violence. Calls to ban the semi­automatic weapon used by the shooter were considered a non-starter in a Republican-controlled Congress where lawmakers are heavily influenced by the National Rifle Association. Funding for new mental health services — one idea raised by some Republicans — would test conservative lawmakers’ commitment to cutting social spending.

A push to restrict “bump stocks,” the device that was used to accelerate gunfire during the massacre at a music festival in Las Vegas in October, seemed like it might succeed last fall with backing from the National Rifle Association. But momentum slipped within a few weeks. At the same time, the Trump administration and congressional Republicans sought ways to loosen existing restrictions on guns.

Students in Parkland called leaders’ lack of action inexcusable, pointing specifically to the age of the alleged shooter, Nikolas Cruz, 19.

“How are we allowed to buy guns at the age of 18 or 19? That’s something we shouldn’t be able to do,” Lyliah Skinner, who survived the shooting, told CNN.

Guillermo Bogan, who is home-schooled but has friends at Douglas High, said the alleged shooter’s age shows the selfishness of the gun industry.

“Some people will just do anything for a dollar,” Bogan said at a midday vigil for the victims. “There should be a background check — are you mentally ill or are you not mentally ill? And clearly he was mentally ill.”

Sen. Chris Murphy (D-Conn.), a vocal proponent of gun restrictions, welcomed the student voices, which he said could help energize the gun-control movement.

“It’s really tragic that one of the ways our movement grows stronger is by having more victims, but that is the reality,” he said.

Some students had harsh words for President Trump, who committed to tackling “the difficult issue of mental health” in an address to the nation that did not mention further gun restrictions.

Speaking to CNN, Douglas High student Isabella Gomez singled out Trump’s remark that students needing help should “turn to a teacher, a family member.”

“What could our teachers do in that situation, rather than save themselves, just as we were?” Gomez said. “I feel like he really needs to take into consideration all this gun control.”

Asked Thursday afternoon whether Trump had heard the pleas of the student survivors and their parents, White House spokesman Hogan Gidley said that the president’s “heart is heavy.” He said Trump would convene a discussion on school safety, though he provided few specifics.

“Today, the president announced that his involvement in upcoming meetings with governors and attorneys general would focus on school safety and protecting children across this country,” Gidley wrote in an email.

Florida Gov. Rick Scott (R) and other state political leaders offered a similar approach, saying they planned to increase funding for mental health services and school safety programs in response to the shooting.

“It’s my goal that this will never happen again in my state,” Scott said.

On Capitol Hill, some Republican and Democratic senators struggled to say what lawmakers would do in response to the shooting.

Sen. Susan Collins (Maine), a more moderate Republican voice on gun restrictions, described several bills she has sponsored to strengthen background checks, prevent straw purchasing and to stop people on the no-fly list from purchasing firearms.

“What happened yesterday is not only so horrific a tragedy but it also has happened far too many times in this country,” she said.

On the Senate floor, Sen. Marco Rubio (R-Fla.) said he sympathizes with people who want action but claimed that recent proposals restricting access to guns would not have prevented the tragedy.

“If someone decides that they are going to take it upon themselves to kill people . . . it is a very difficult thing to stop,” he said. “When someone is planning and premeditating an attack, they will figure out a way to evade those laws or quite frankly to comply with them in order to get around it.”

Murphy called Rubio’s comments “gun-industry pablum.”

“The idea that no laws can stop bad people from doing bad things — if that were the case, we should give up on government altogether,” Murphy said. “It’s an excuse for people who have already sold their soul to the gun lobby.”

At the vigil in Parkland, not all students were confident that policymakers can solve the problem.

“This stuff happens and we don’t know why,” said Mia Veliz, a senior at Calvary Christian Academy in nearby Fort Lauderdale. “There is nothing we can do to stop it.”

Tim Craig in Parkland and Philip Rucker and Ed O’Keefe in Washington contributed to this report.