When Dwight and Steven Hammond left federal prison Tuesday, it was in large part thanks to a Portland attorney who was politically and culturally their opposite.

Larry Matasar, 68, is a political progressive who volunteered on Barack Obama's 2008 campaign. He's a self-described child of the '60s and rock aficionado who has attended more than 100 Bruce Springsteen shows. He's an urban creature from Chicago's South Side.

"It's a long, long way from Burns," he said in reference to the Eastern Oregon town nearest the Hammonds' remote 12,000-acre ranch.

Yet Matasar has represented the family for 25 years and connected with them personally. It was Matasar who represented the father and son in the controversial arson case that made them unwitting heroes in the anti-government land rights movement.

"Everything about them rings true, the way they interact with one another, with their children," Matasar said. "They're good people. I'm glad I got to know them."

Matasar was also part of the legal team that petitioned the White House to commute the Hammonds' sentences. On Tuesday, he was thrilled when President Donald Trump instead granted them full pardons.

"Trump gave them more than they asked for," said Margaret Love, a former pardons lawyer in the George H.W. Bush and Clinton administrations who was hired by the Hammonds. "It was unexpected, to say the least."

In a case that inspired the 41-day occupation of the Malheur National Wildlife Refuge by armed protesters, the Hammonds were sent to prison for five years -- the mandatory minimum -- after they'd already served the sentences imposed by U.S. District Judge Michael Hogan. The now-retired judge found the sentencing guideline excessive and refused to follow it.

But the local U.S. Attorney's Office, then led by Amanda Marshall, appealed. And the government got its five-year sentences. The Hammonds reported back to prison in early January 2016. The same day, Ammon Bundy led the occupation.

The Hammonds found a high-profile supporter in U.S. Rep. Greg Walden of Hood River. The conservative Republican took to the floor of the U.S. Capitol to protest the Hammonds' treatment on the day they were returned to prison.

Matasar and Walden then started working to get the White House interested.

Two decades of mounting ill will between the Hammonds and federal government over how best to manage their adjacent rangeland erupted into something far more serious in June 2010. Federal prosecutors charged the ranchers with multiple counts of arson, conspiracy and other charges.

Dwight Hammond set a prescribed burn on about 300 acres of his own land that then traveled onto Bureau of Land Management property and burned an additional 139 acres. He said he was trying to fend off invasive species. But prosecutors argued the fire was designed to cover up illegal deer poaching and got out of control. Marshall said the federal pursuit of the Hammonds followed years of permit violations and unauthorized fires.

Prosecutors chose to file a specific type of arson under a 1996 statute passed by Congress in the wake of the Oklahoma City bombing. The Antiterrorism and Effective Death Penalty Act gave law enforcement and federal lawyers a panoply of new tools to fight terrorism, including a new five-year mandatory minimum sentence for arson.

Even Frank Papagni, the federal prosecutor in the case, was uncomfortable with the severity of the sentence required.

"Perhaps the best argument, judge, the defendants have in this case is the proportionality of what they did to what their sentence is," Papagni said at the sentencing hearing. "Perhaps that's the most troubling for the court. It is for the prosecutor who tried the case. That being said, I have done my job as I see it."

Hogan stunned just about everyone when he refused to impose the five-year sentence, deeming it a violation of the Eighth Amendment ban on cruel and unusual punishment.

Instead, Hogan sentenced Dwight Hammond to three months and Steven Hammond to a year in prison. They had done their time and were back at their ranch living their lives when the case came back to haunt them. In 2014, the 9th U.S. Circuit Court of Appeals reversed the sentence and sent it back to Oregon. In October 2015, U.S. District Court Judge Ann Aiken said she lacked the discretion to vary from the five-year sentences.

On Jan. 4, 2016, the Hammonds reported back to prison.

Walden took to the floor of the Capitol to blast the sentencing. "I have seen the impact of federal policies from the Clinton administration to the Obama administration," he said. "I have seen what happens when overzealous bureaucrats and agencies go beyond the law and clamp down on people."

A heartsick Matasar was nearly out of options. He resorted to the ultimate "Hail Mary" maneuver in the criminal defense world -- he asked the White House to intervene and commute Steven Hammond's sentence.

Kendra Matthews, another Portland lawyer, filed a similar request for Dwight Hammond.

The Oregon Farm Bureau, the Oregon Cattleman's Association and two local sheriffs wrote letters of support.

But Democrats were leery of the case. The Bundy occupation made the case too hot to handle, said Barry Bushue, head of the Oregon Farm Bureau. "It became hyper-political," Bushue said. "It set back the Hammonds' cause."

Matasar went to Sen. Jeff Merkley, D-Oregon, to plead the Hammonds' case. Merkley declined to get involved.

And though his administration spent considerable time and political capital working on sentencing reform and ultimately commuted the sentences of some 1,700 drug offenders, the Obama administration also had no appetite for the Hammond case.

But the political landscape changed in November 2016 when Trump was elected.

Suddenly, the Hammonds had an ally in the White House.

Still, Matasar said he had little hope until last Aug. 17. That was the day Trump pardoned controversial Arizona Sheriff Joe Arpaio, who's been convicted of criminal contempt over his hard-line tactics with undocumented immigrants. After a "life's work of protecting the public from the scourges of crime and illegal immigration, Trump said, the 85-year-old Arpaio deserved a pardon.

On June 27, Walden again brought the case to the floor of the House. "It's time for the president to review this situation and to grant a pardon to Steven and Dwight Hammond, pull them back together with their families," Walden said. "They have served long enough."

By that time, Steven Hammond had spent four years in prison.

Whether Walden's remarks proved the final impetus is unclear. But early Tuesday, Walden called Susie Hammond, Dwight's wife, waking her out of a deep sleep. "He said it's a done deal, the papers were signed,'' she said. "We've been waiting a long time. I think it's wonderful.''

Environmental and public lands groups have a much darker view of both the Hammonds and of Trump's pardon.

Jennifer Rokala, executive director of the Center for Western Priorities, told The Oregonian/OregonLive that the pardons sent a "dangerous message" to America's park rangers, wildland firefighters and public land managers.

"President Trump, at the urging of Interior Secretary Ryan Zinke, has once again sided with lawless extremists who believe that public land does not belong to all Americans,'' she said.

"Trump's pardon abandons human decency and will encourage more violence and extremism among his base," said Kieran Suckling, executive director of the Center for Biological Diversity.

The White House had a different take: "The Hammonds are devoted family men, respected contributors to their local community and have widespread support from their neighbors, local law enforcement and farmers and ranchers across the West. Justice is overdue for Dwight and Steven Hammond, both of whom are entirely deserving of these Grants of Executive Clemency.''

Matasar heard the news from reporters Tuesday morning. About six hours later, the Hammonds, now 76 and 49 years old, walked out of a federal prison in California.

-- Jeff Manning