Romanian security guard Marin Eugen Sabau, 46, in December opened fire on three colleagues and a policeman, wounding several, in the northeastern port city of Tarragona, before he was shot in the spine, which paralysed him.
“In accordance with the euthanasia scheduled for today, Marin Eugen Sabau died at 6:30 pm (1630 GMT)” in hospital, his lawyer Gerard Amigo said.
Sabau had previously told the press his job had been “hell” and accused his bosses of racism.
After the shooting, he was taken to a prison hospital in the northeastern town of Terrassa, and pleaded for the right to die.
A judge in July ruled that he had it was his “fundamental right” to terminate his life.
“I am paraplegic,” he had told her. “I have 45 stitches in my hand. I can’t move my left arm. I have screws (in my body) and I can no longer feel my chest.”
The lawyers of those he had shot had objected, demanding a trial so that he could compensate his victims.
José Antonio Bitos, a lawyer representing two of those wounded, said his clients were “frustrated”.
“We were not opposed to the euthanasia per se, but to it happening before the trial.”
Spain legalised euthanasia in June last year, becoming the fourth European nation to do so after the Netherlands, Belgium and Luxembourg.
It has been applied in some 180 cases since, according to official numbers.