President Donald Trump took to Twitter Thursday night to criticize the decision of an American jury in a case he'd regularly cited at political rallies.

A jury earlier Thursday had found a Mexican man not guilty in the killing of a woman on a San Francisco pier that touched off a fierce national immigration debate two years ago, rejecting possible charges ranging from involuntary manslaughter to first-degree murder.

The shooting of Kate Steinle came during the presidential primary campaign in 2015 and was used by then-candidate Trump to push for a wall on the Mexican border.

After the decision, the president of the country said: "A disgraceful verdict in the Kate Steinle case! No wonder the people of our Country are so angry with Illegal Immigration."

@realDonaldTrump A disgraceful verdict in the Kate Steinle case! No wonder the people of our Country are so angry with Illegal Immigration.

@realDonaldTrump The Kate Steinle killer came back and back over the weakly protected Obama border, always committing crimes and being violent, and yet this info was not used in court. His exoneration is a complete travesty of justice. BUILD THE WALL!

Trump tweet 3

Defense attorney Francisco Ugarte drew a very different picture after the verdict.

"From Day 1 this case was used as a means to foment hate, to foment division and to foment a program of mass deportation. It was used to catapult a presidency along that philosophy of hate of others," Ugarte said. "I believe today is a day of vindication for the rest of immigrants."

Jose Ines Garcia Zarate had been deported five times and was wanted for a sixth deportation when Steinle was fatally shot in the back while walking with her father on the pier.

The case spotlighted San Francisco's "sanctuary city" policy, which limits local officials from cooperating with U.S. immigration authorities.

Politics, however, did not come up in the monthlong rial that featured extensive testimony from ballistics experts. Defense attorneys argued that Garcia Zarate was a hapless homeless man who killed Steinle in a freak accident. Prosecutors said he meant to shoot and kill her.

Garcia Zarate did not deny shooting Steinle and said it was an accident.

Jurors did find him guilty of being a felon in possession of a firearm, meaning he knowingly had a firearm but there was no intent for him to hurt or shoot anyone. Public Defender Jeff Adachi said the count carries a potential sentence of 16 months to three years behind bars.

"The verdict that came in today was not the one we were hoping for," said Alex Bastian, a spokesman for the San Francisco prosecutor's office. "The jury came back with the verdict they did, and we will respect that decision. ... This is really about the Steinle family. They showed incredible resolve during this whole process."

Jim Steinle told the San Francisco Chronicle the family was saddened and shocked by the verdict.

"There's no other way you can coin it. Justice was rendered, but it was not served," he said in what he called the last interview he would do about the case.

The family did not attend the reading of the verdict. Jurors left without comment and the judge sealed their names.

Before the shooting, Garcia Zarate finished a federal prison sentence for illegal re-entry into the United States and had been transferred to San Francisco's jail in March 2015 to face a 20-year-old charge for selling marijuana.

The sheriff's department released him a few days later after prosecutors dropped the marijuana charge, despite a request from federal immigration officials to detain him for deportation.

The Trump administration has sought to punish sanctuary cities through a series of legal actions, including an executive order to withhold funding, but a federal judge recently blocked it in a lawsuit from two California counties, San Francisco and Santa Clara. The administration has appealed.

Attorney General Jeff Sessions said in a statement Thursday that San Francisco's decision to release Garcia Zarate led to Steinle's death.

"The Department of Justice will continue to ensure that all jurisdictions place the safety and security of their communities above the convenience of criminal aliens," Sessions said. "I urge the leaders of the nation's communities to reflect on the outcome of this case and consider carefully the harm they are doing to their citizens by refusing to cooperate with federal law enforcement officers."

Immigration and Customs Enforcement officials did not immediately respond to a request for comment.

San Francisco Deputy District Attorney Diana Garcia said during the trial that she didn't know why Garcia Zarate fired the weapon, but he created a risk of death by bringing the firearm to the pier and twirling around on a chair for at least 20 minutes before he fired.

"He did kill someone. He took the life of a young, vibrant, beautiful, cherished woman by the name of Kate Steinle," she said.

Defense attorney Matt Gonzalez said in his closing argument that he knows it's difficult to believe Garcia Zarate found an object that turned out to be a weapon, which fired when he picked it up.

But he told jurors that Garcia Zarate had no motivation to kill Steinle and that as awful as her death was, "nothing you do is going to fix that."

Garcia Zarate was sitting about 90 feet (27 meters) from Steinle when the gun fired. The bullet ricocheted on the pier's concrete walkway and fatally struck Steinle in the back.

The gun was stolen from the SUV of a U.S. Bureau of Land Management ranger that was parked in San Francisco. The city has been plagued by an epidemic of car burglaries in recent years.

—CNBC contributed to this report.