Parishioners kneel in prayer during Sunday service at the Santo Niño de Atocha church in El Paso. The pastor asked the congregation to think of those who are suffering in the wake of the shootings here and in Dayton, Ohio, that have left at least 29 dead. (Michael Robinson Chavez/The Washington Post)

Shortly before a gunman opened fire outside a Walmart in El Paso, killing 20 people and injuring dozens more, a manifesto believed to be linked to him was posted online. It railed against a “Hispanic invasion” and laid out a plan to divide the United States into territories based on race.

Authorities believe 21-year-old Patrick Crusius wrote the document, though they are still gathering evidence.

It begins by praising the manifesto of the gunman who killed 51 Muslims at two mosques in New Zealand earlier this year. That document cited a white supremacist theory known as “The Great Replacement,” which postulates that a secret group of elites is working to destroy the white race by replacing them with immigrants and refugees.

“This attack is a response to the Hispanic invasion of Texas,” the manifesto says.

After a brief introduction, the 2,300-word manifesto is divided into five sections: political reasons for the attack, economic reasons, equipment that will be used to carry out the shooting, the expected reaction to the attack, and “personal reasons and thoughts.” Titled “The Inconvenient Truth,” the document is a jumble of positions and ideologies. In it, the writer warns of the dangers of environmental degradation, rails against corporate influence in the government and cautions against interracial marriage.

Under “political reasons,” the manifesto lambastes both Democrats and Republicans, suggesting the United States will soon become a one-party state run by Democrats because of the growing Hispanic population, the death of the baby-boom generation and the “anti-immigrant rhetoric of the right.” The author postulates that the growing Hispanic population in Texas will soon make it a solidly Democratic state, which he argues would all but assure repeated Democratic presidential victories.

“The Democrat party will own America and they know it. They have already begun the transition by pandering heavily to the Hispanic voting bloc in the 1st Democratic Debate,” the manifesto says.

The document repeatedly rails against corporations, which the author says have taken over the government. The author criticizes Republicans for favoring corporations, but argues that “at least with Republicans, the process of mass immigration and citizenship can be greatly reduced.”

The author also expresses fear over the impact automation will have on job opportunities and argues that immigrants should not be allowed to continue coming into the country as long as job opportunities are scarce. He argues that while immigrants often take menial jobs that Americans are unwilling to perform, their children seek better opportunities and often receive college degrees that allow them to obtain high-skill positions. The document again blames corporations for advocating for work visas for skilled workers and says they rely on immigrants to fill low-skilled positions.

In a jumbled rant, the document rails against corporations for destroying the environment by over-harvesting resources. The manifesto chastises the government for being unwilling to confront environmental issues and most Americans for being unwilling to change their lifestyles to be more environmentally friendly. It argues that the United States therefore needs fewer people consuming resources.

The author wrote that he planned to mainly rely on an AK-47 as his weapon for the shooting, noting that it overheats after about 100 rounds and that he would need a heat-resistant glove.

The manifesto notes that many migrants return to their home countries to reunite with family, arguing that “the Hispanic population is willing to return to their home countries if given the right incentive. An incentive that myself and many other patriotic Americans will provide.” The author writes that such terrorist attacks will “remove the threat of the Hispanic voting bloc.”

In the “personal reasons and thoughts” section, the author writes that he has spent his life preparing for a future that does not exist, though does not specify what that future would be. He ends on an anti-immigrant screed, worrying that Hispanics will take over the Texas government and says the Founding Fathers have given him the rights — presumably referring to the right to bear arms — to save the country from destruction.

“Our European comrades don’t have the gun rights needed to repel the millions of invaders that plaque [sic] their country. They have no choice but to sit by and watch their countries burn,” the manifesto says.

Finally, the manifesto ends by decrying interracial couples and proposes separating the United States into territories based on race. The author points to white supremacist theories that “stronger and/or more appealing cultures overtake weaker and/or undesirable ones.”

The author expresses fear that he will be captured, rather than die during the shooting, because that would mean he would receive the death penalty and his family would despise him. And he stresses that he has maintained his white supremacist ideology for many years, predating President Trump and his 2016 campaign, which he says did not influence his reasons for carrying out the attack.

“This is just the beginning of the fight for America and Europe,” the author writes.