During the trial Jeon Chang-Han, 28, reportedly admitted illegally entering the shrine and detonating the bomb in a case that highlighted lingering tensions over Japan's harsh colonial rule of the Korean peninsula from 1910-45.
"The court handed down a four-year prison sentence with no suspended term," a Tokyo District Court spokesman told AFP, without elaborating.
Prosecutors had demanded a five-year sentence, claiming the explosion was an act of terrorism, according to Jiji Press.
Yasukuni Shrine, which honours millions of Japan's war dead including several senior military and political figures convicted of war crimes, has been targeted in the past by activists.
Visits by senior Japanese politicians to the shrine routinely draw an angry reaction from China and South Korea, which view them as an insult and painful reminder of Japan's militarist history.
Presiding judge Kazunori Karei said the explosion was "highly dangerous and malicious", Jiji reported.
Jeon left Japan after the blast, in which no one was hurt, but was arrested when he returned in early December reportedly carrying two kilogrammes (4.4 pounds) of gunpowder.
Judge Karei said that having failed to achieve the desired attention from the blast, Jeon plotted another one and had a large amount of gunpowder when he returned to Japan.
"It could have developed into a serious incident," he said.
South Korea's Yonhap news agency quoted Jeon's mother as saying an appeal was likely.
"The sentence is tougher than we expected," she said in an interview with Yonhap, which did not provide her name.
"It is a preposterous ruling and we are hopeful because it's not over yet," she added. "We heard we can appeal the decision by August 2."
South Korea's foreign ministry declined to comment on an ongoing court case but said it was providing consular assistance for Jeon.
Follow NDTV for latest election news and live coverage of assembly elections 2019 in Maharashtra and Haryana.
Subscribe to our YouTube channel, like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.