Something unthinkable happened in Minneapolis over the past two weeks: The Police Department lost its legitimacy. The public, roiling over the killing of George Floyd, withdrew its consent. The Minneapolis Public Schools and the University of Minnesota ended their security contracts with the Police Department. A veto-proof majority of City Council members pledged to "dismantle" it.

Now, the city is entangled in a political fight about how to create a system of public safety that does not depend on a domineering police force. In the absence of clear alternatives, forces opposing change are starting to coalesce. Yet the answers are right there. Even in the chaos of the past two weeks, ordinary people took control of their own safety and we learned that the safest system is one grounded in and accountable to an organized community.

I study grassroots movements and have partnered for several years with organizers in Minneapolis on research. For the first few nights after the killing of George Floyd on May 25, they described to me a loose network of young black leaders and organizations like Black Visions Collective that drove the continuing and growing street movements against the police. Opportunists, however, were taking advantage of confusion to sow destruction.

Yet a network of community defenders quickly emerged to protect residents. Their goals? Protect people's ability to safely protest and tamp down on the chaos. These community defenders sought to enable democracy, not squelch it, so that organizers could advance the struggle for reforms.

By the third night, Valerie Fleurantin, a community leader and Haitian fitness instructor, told me she saw "targeted arson of minority-owned businesses." Buildings in neighborhoods on the North Side, which local residents call "Black City," began to burn even though there were no active protests there.

Jeremiah Ellison, the City Council member who represents that area, wrote on Twitter that when a black barbershop called the Fade Factory burned, he had "a hard time believing ANYONE who lives here would set it ablaze" because it "was a valued institution."

No one came to help. "I kept calling, but no one answered 911," Fleurantin said. The opportunists stretched the city's existing public safety system to the breaking point.

Community leaders throughout the city organized a coordinated response, which the police, military and disconnected elected officials never could. Widespread confusion created by decentralized sources of destruction all around the city required a carefully networked response that was grounded in trusted community relationships.

Leaders put out calls on social media and through their own networks, and more than 1,000 residents showed up for a public meeting in Powderhorn Park. They created a plan for community defense that got shared on Facebook almost 8,000 times and crashed the website of the organization that hosted it.

Using social media and text chains among many households, neighbors looked after neighbors. They swept their alleyways to find fire accelerants that outsiders had planted, and reported to one another boxes of kindling doused with gasoline. They sat on their porches, asking strangers to account for themselves, and checking on one another. A group of Somali women chased a cluster of suspicious white men out of the Karmel Mall. Local pastors organized people to protect local grocery stores. Some groups organizing to protect local businesses had to arm themselves, but their focus was on defense. Ashley Fairbanks, an Indigenous Anishinaabe activist, helped organize people to create their own fire patrols.

City leaders recognized the importance of the community response. The City Council president, Lisa Bender, wrote on Twitter that "we see how community members are working to keep each other safe." Ellison wrote, "Every night it blows me away how successful these civilian patrols have been."

Abdulahi Farah, a Somali organizer, told me, "White men slept overnight in a mosque with Muslim leaders to protect it." When some neighborhood patrols began to veer toward profiling racial minorities, community members widely circulated a set of directions about how to hold one another accountable for staying true to their values, instead of recreating a police state.

This work was possible only because organizers could build on years of organizing that connected people and built the skills they needed to mobilize a rapid response. As Fairbanks said: "No single person or organization made this happen. It took years of people, especially black women, doing the groundwork of building trust and accountability. It takes years of conversations about what it means to be community. That is what gave us the opportunity to align when we needed to."

Those connections are like antibodies that can be activated to rapidly develop a community immune response, anchoring the community even in the midst of tremendous public confusion. The fast-moving information environment meant people were constantly trying to differentiate fact from fiction. Trusted sources of information became ever more important.

Fleurantin, who used to work for Target and a corporation that makes medical devices, said, "My former white co-workers in corporate America were sharing my stuff because they knew me and trusted what I was seeing and reporting." Organizations and leaders grounded in relationship with people could teach them to identify <opportunists and interlopers and combat misinformation.

It will take us years to understand exactly what has been and will happen in Minneapolis. The path to building a new system of public safety will be neither easy nor linear. But the experience of community defense over the past two weeks offers us a glimmer of the kinds of alternatives that are possible.

The solution is not to meet destruction with destruction, or to douse the flames of people's pain with empty words. Instead, what we learn from Minneapolis is that when people create solidarity from the ground up, they can hold one another and public institutions accountable to a higher standard that reflects all of their shared interests. Democratic institutions are only as strong as the public allows them to be; when institutions fail, it is up to people to become the guardians of democracy.

Alondra Cano, a member of the City Council who leads its public safety committee, captured it best when she said to a reporter, "Protesting is good and needed," but "that third space is needed where we are committed to each other."

Hahrie Han is the director of the SNF Agora Institute at Johns Hopkins University, where she is a professor of political science. She wrote this article for the New York Times.