WASHINGTON – President Donald Trump suggested Thursday that a bipartisan panel is doomed to failure in its effort to strike a deal on border security and immigration, writing on Twitter that the lawmakers are "wasting their time."

History shows he's probably right.

President Ronald Reagan signed a sweeping immigration deal into law in 1986 that allowed 3 million immigrants to become citizens but never fulfilled its promise of securing the border.

Since then, there have been several episodes where grand bargains seemed close at hand but negotiations ultimately ended in failure and finger pointing.

This time, it's up to a bipartisan panel of seven senators and 10 House members to reach a deal. Trump has warned if no agreement is in place by Feb. 15, the federal government will shut down again or he will declare a national emergency to get money for a wall along the U.S.-Mexico border.

Here's a look at how past immigration and border security talks have played out.

'Gang of Eight' effort falls short

In 2013, a bipartisan group of four Democratic and four Republicans senators known as the "Gang of Eight" hammered out a deal that would have provided a 13-year path to citizenship for some 11 million undocumented immigrants living in the U.S., including the roughly 800,000 undocumented immigrants who entered the U.S. as children – a group referred to as "Dreamers" – if they passed certain security checks.

In exchange, the deal would have doubled the number of Border Patrol agents to nearly 40,000 and committed billions of dollars for drones and other "smart technology" to better monitor the nearly 2,000-mile border with Mexico.

The deal also included a provision to begin fingerprinting all foreigners departing U.S. airports to better track who's left the country and who has stayed past the expiration of their visas, and one to increase the number of work visas for foreigners in the agricultural industry. A new class of visa would be created to bring in people to work lower-skilled jobs in construction, retail, hospitality and insurance.

Something for everyone, in essence.

The measure, with the backing of President Barack Obama, passed the Senate overwhelmingly: 68 to 32. But it never got a vote in the Republican-controlled House because hard-line conservatives pressured GOP Speaker John Boehner not to bring it up.

Little appetite for revival

Six of the eight senators are still on Capitol Hill: Democrats Chuck Schumer of New York, Richard Durbin of Illinois, Robert Menendez of New Jersey, and Michael Bennet of Colorado; and Republicans Lindsey Graham of South Carolina and Marco Rubio of Florida.

But some of them don't sound like they're ready to make a deal any time soon.

Graham has urged Trump not to cave on wall funding. Schumer, now the Senate minority leader, is walking lockstep with Pelosi in opposition to a wall. And Rubio, a Cuban-American whose role in the deal cost him support among the GOP base during his 2016 presidential run, told CNN's "State of the Union" Sunday that Republicans shouldn't be "trading border security because it's something we're all for."

Theresa Cardinal Brown, an immigration expert at the Bipartisan Policy Center in Washington, believes there's a road map to shore up border security and protect Dreamers and immigrants under Temporary Protected Status (TPS).

Such a deal would include more Border Patrol agents at ports of entry, enhanced surveillance across the border and "physical barriers in appropriate sectors" as carrots for GOP support. In turn, Dreamers and TPS Holders would receive immediate protection from deportation and be given a path to a green card – and ultimately citizenship – after meeting conditions such as work, study or service.

Past efforts left bad feelings

Previous attempts to tackle immigration reform indicate it won't be easy convincing negotiators on the fairness of a deal this time.

The 1986 deal signed by Reagan sought to broadly address rising immigration across the U.S.-Mexico border.

Like the reform efforts that have failed since then, it included increased border security, punishment for employers hiring undocumented workers and a path to legal status for those already in the country illegally. About 2.7 million immigrants were awarded green cards because of the law but another 2 million undocumented people were either ineligible or never applied, according to The Washington Post.

How we got here: The many attempts to reform immigration, secure the border

The last major immigration legislation to make it into law were the 1996 Personal Responsibility and Work Opportunity Act and the Illegal Immigration Reform and Immigrant Responsibility Act, both passed by a GOP Congress and signed by President Bill Clinton.

The first blocked immigrants (both legal and illegal) from getting food stamps and other public benefits. The second toughened penalties for illegal immigrants, expanded the number of crimes that could be used to deport immigrants, further restricted public benefits to legal immigrants, increased the number of Border Patrol agents and established the program that lets local police double as federal immigration-enforcement officers.

Some benefits were later restored to legal immigrants. Although the laws were aimed at removing some of the incentives to migrate to the U.S. and to tighten the border, the number of people crossing into the country illegally continued to climb.

Bush promoted an immigration deal

President George W. Bush began discussions with Mexican President Vicente Fox about a possible accord on migration shortly after taking office in 2001, but those talks were put on hold after the Sept. 11, 2001, terrorist attacks.

In his second term, Bush put his weight behind a push for comprehensive immigration reform with Republicans in control of both the House and Senate.

The House passed a bill in December 2005 that expanded border security and toughened immigration laws, making many violations felonies, sparking massive protests across the country. The Senate countered with a measure, spearheaded by Sen. John McCain, R-Ariz., and Sen. Ted Kennedy, D-Mass., to beef up border security but also include a path to citizenship for undocumented immigrants and an expanded guest worker program.

It withered when the House and Senate failed to form a conference committee to meld the measures together.

The effort was rekindled after Democrats took control of the Senate in 2007. With Bush’s encouragement, a bipartisan "Gang of 12" senators worked to craft a comprehensive immigration deal.

The compromise made employers’ enrollment in the E-Verify system mandatory, increased the penalties for companies with a history of employing undocumented workers, added thousands of border agents and customs inspectors, approved “not less than 370 miles of triple-layered fencing,” toughened the laws for people evading immigration officials or using fake documents, enhanced technology to detect border crossings, expanded the guest worker program, and included a path to citizenship.

Reform derided as 'amnesty'

But that effort fell short of the needed 60 Senate votes to overcome a filibuster as more than a dozen Democrats voted with Republicans opposed to a path to citizenship.

Creating a process for undocumented migrants living in the U.S. to become legal residents was derided as “amnesty” by opponents to the measure like Sen. Jeff Sessions, R-Ala., and Sen. David Vitter, R-La. Some unions decried the guest worker program as a way to secure cheap labor, while immigration activists opposed a part of the bill that reduced the family members of legal migrants who are eligible for preferred immigration status.

"A lot of us worked hard to see if we couldn’t find common ground," Bush said after the bill failed for the final time in the Senate in June 2007. "It didn’t work."

Then last year, Trump and Senate Democrats seemed to be closing in on a deal to fund the wall in exchange for legal protections for Dreamers.

The deal never materialized with both sides accusing the other of not negotiating in good faith.

"The wall offer is off the table," Schumer told reporters after talks broke down. "That was part of a package" that's now defunct.

Trump responded publicly by tweeting that "Cryin’ Chuck Schumer fully understands, especially after his humiliating defeat, that if there is no Wall, there is no DACA. We must have safety and security ... "

Contributing: Daniel González and Dan Nowicki, The Arizona Republic