They've lived legally in the United States for nearly two decades.

And now, they have less than two years to leave, find another legal way to stay or face deportation.

The decision, hailed by immigration hardliners and slammed by immigrant rights groups, left thousands of people shaken and uncertain about their families' futures.

"After 17 years of a normal life, everything just vanished," said Cristian Chavez, 37.

An IT worker in Houston, Texas, Chavez told reporters Monday he wasn't sure what he'd do next.

"I feel lost," he said. "It's like all my plans for the future are just dead."

As officials explain their decision and activists push for Congress to step in, here's a look at some of the key events and issues at play:

It started with an earthquake.

The 7.7-magnitude quake that struck El Salvador in January 2001 was the worst to hit the country in a decade . Then, two powerful quakes shook the country the following month.

Neighborhoods were buried. Homes collapsed. More than 1,100 people were killed. Another 1.3 million were displaced.

A girl sits in front of a building destroyed by the January 2001 earthquake in San Agustin, El Salvador.

The devastation spurred a decision that March by then-US Attorney General John Ashcroft: Immigrants from El Salvador who'd been in the United States since February 2001 could apply for temporary protected status, or TPS , which would protect them from deportation and allow them to get work permits. It was an 18-month designation

Now, it's been nearly 17 years. Time after time, officials from different administrations determined that conditions in El Salvador hadn't improved enough for migrants with TPS to return . On Monday, the Trump administration said it decided to end protections effective September 9, 2019.

Some 400,000 affected?

Estimates differ for exactly how many immigrants the decision will affect. There were 263,282 Salvadoran TPS beneficiaries at the end of 2016, according to the latest statistics provided to CNN by US Citizenship and Immigration Services. Activists and experts have put the number of Salvadorans who could lose protections closer to 200,000, noting that official statistics likely include people who are no longer in the program because their immigration status has changed or they have left the United States.

There's also another group experts say will be affected: nearly 200,000 US citizen children of Salvadoran parents with TPS.

"Our family will break apart. ... What am I going to do now?" said Chavez, who is raising two stepchildren and a cousin in Houston. "How can I tell them that I have to go?"

JUST WATCHED Congressman: El Salvador decision is tragic Replay More Videos ... MUST WATCH Congressman: El Salvador decision is tragic 01:28

Immigrant rights advocates say it is unfair and cruel to end TPS for Salvadorans who've built lives, paid taxes, contributed to the economy and raised families for nearly two decades in the United States. They also argue that violence and widespread poverty make it unsafe for migrants to return to El Salvador.

Those who support ending TPS for Salvadorans and other immigrants, such as the Federation for American Immigration Reform, say there's a reason the designation was referred to as "temporary" and argue that conditions in El Salvador are good enough for migrants to return.

Salvadoran immigration to the US has a long history.

El Salvador is about the size of New Jersey. And it's nearly 2,000 miles from Washington.

But the small country of 6.2 million people has become a big deal in the US immigration debate.

Even before the earthquakes, Salvadoran immigrants had been streaming into the United States. A major driver: the country's civil war, which lasted from 1980 to 1992. Experts estimate the conflict sent more than 25% of El Salvador's residents fleeing for their lives. More than 330,000 Salvadorans came to the United States between 1985 and 1990, according to the Migration Policy Institute

About 465,000 of the Salvadoran immigrants living in the United States are undocumented, according to an estimate from the Migration Policy Institute

In the last five years, more than 58,000 unaccompanied minors from El Salvador were apprehended at the US-Mexico border, according to US Customs and Border Protection . And in the last fiscal year, which ended in September, more than 24,000 Salvadoran parents and children traveling together were apprehended at the border.

A mother and her 3-year-old child from El Salvador await transport to an immigrant processing center after they crossed the Rio Grande into the United States on July 24, 2014.

El Salvador's murder rate is one of the highest in the world, and experts have said poverty and violence were major factors fueling the recent migration wave

MS-13: A new Public Enemy No. 1

The Trump administration has repeatedly tied the youth apprehended at the border to the notorious Mara Salvatrucha gang, known as MS-13.

And Trump frequently invokes MS-13 as he vows to step up immigration enforcement.

JUST WATCHED Trump's strong words for MS-13 Replay More Videos ... MUST WATCH Trump's strong words for MS-13 00:46

MS-13 is strongest in Central America, especially El Salvador. But the gang actually began in Los Angeles in the 1980s, during another wave of Salvadoran migration. Analysts say its offshoots in Central America took hold when members were deported by the US.

Immigrant rights groups say it's misleading to use MS-13 as an excuse for any crackdown and note that many of the gang's victims are immigrants.

JUST WATCHED MS-13 gang members: Trump makes us stronger Replay More Videos ... MUST WATCH MS-13 gang members: Trump makes us stronger 05:45

In 2017, more than 1,200 people with suspected gang ties were deported to El Salvador, according to migration officials there . That's more than double the number of suspected gang members deported to El Salvador in 2016.

While MS-13 and TPS are separate issues, some see the Trump administration's escalation in tough talk about the gang as a bellwether for officials' approach toward the region.

El Salvador relies on money from immigrants.

Officials in the Central American country painted the Trump administration's announcement Monday as a victory, with President Salvador Sánchez Cerén taking to Twitter to praise what he described as the "extension" of TPS until September 2019.

But ending TPS for Salvadorans could be a big blow to El Salvador's economy.

Remittances, the money immigrants send home, make up more than 17% of El Salvador's GDP.

Most of that money, experts say, comes from Salvadorans living in the United States.

And Salvadoran officials have taken note.

"Ending TPS will be catastrophic for El Salvador's economy," Foreign Minister Hugo Martinez wrote in a recent op-ed , "because it will add more deportees to the ranks of the unemployed and eliminate the remittances, which support many families in El Salvador."

This isn't the first -- or last -- time you'll hear about TPS.

Congress created TPS in 1990 as a form of humanitarian relief for people who would face extreme hardship if forced to return to homelands devastated by armed conflict and natural disasters. Currently, about 437,000 people from 10 countries have TPS, according to the Congressional Research Service , but tens of thousands will lose that protection in the coming years.

Salvadorans are just the latest group whose TPS designation is on the chopping block.

Last month, the Trump administration announced that in July 2019 it would end TPS for more than 50,000 Haitians who sought refuge in the United States after a catastrophic earthquake hit that country in 2010.

Last year, officials also announced that TPS for Nicaraguan and Sudanese immigrants would end.

Honduran immigrants got a brief reprieve in November, when the Department of Homeland Security postponed its decision about how to handle the roughly 86,000 people with TPS from that Central American nation, triggering an automatic six-month extension. But later this year, that decision will once again be up for review.

This year officials will also have to decide whether to extend TPS for Nepal, Somalia, Syria and Yemen. The Trump administration extended TPS for South Sudan last year and will reconsider the issue again in 2019.

Some activists are also pushing for Congress to come up with a more permanent solution. A bill introduced last year would give people with TPS an opportunity to apply to become permanent US residents.

This story has been updated to reflect Monday's decision and add more detail about why some experts and activists say fewer Salvadorans would be affected.