He was arrested again in 2014, and his wife, Jasmine Lima-Marin, has been working with lawyers to free him ever since.

On Wednesday, Mr. Lima-Marin was released from state custody after a judge said it would be “draconian” to keep him in prison. That morning, Mr. Lima-Marin’s lawyer, Kimberly Diego, had been expecting him to walk free. “We’ve been working on this since 2015 — it seems like forever!” she said in a phone interview at the time.

But it turned into a “devastating” evening, Ms. Diego said later, after Mr. Lima-Marin was put in custody of Immigration and Customs Enforcement because of his status as an immigrant with a felony conviction. “Him being put into ICE custody was not something I personally expected,” she added.

She held out hope that the governor’s pardon could remove the legal basis for Mr. Lima-Marin’s deportation. The State Legislature recommended the pardon in a resolution this month. Governor Hickenlooper said he made his decision Friday to grant the pardon because Mr. Lima-Marin was “a model for what we would want every convict to do” upon getting released from prison.

He reached out to Ms. Lima-Marin during the afternoon to deliver the news personally.

“She was a little surprised to have me call her,’’ the governor said in a phone interview. “She was speechless for a second. She started to cry tears of joy.”