Paramilitary police officers patrol inside Pudong airport in Shanghai after an explosion near a check-in counter on June 12, 2016. 
A blast caused by "home-made" explosives injured four people and sparked a major security alert at the main international airport in China's commercial hub of Shanghai on June 12, according to the operator and state media. / AFP / STR / China OUT        (Photo credit should read STR/AFP/Getty Images)
STR/AFP/AFP/Getty Images
Paramilitary police officers patrol inside Pudong airport in Shanghai after an explosion near a check-in counter on June 12, 2016. A blast caused by "home-made" explosives injured four people and sparked a major security alert at the main international airport in China's commercial hub of Shanghai on June 12, according to the operator and state media. / AFP / STR / China OUT (Photo credit should read STR/AFP/Getty Images)
Now playing
00:47
Man detonates bomb at airport before attempting suicide
us customs computers down schiavo security sot _00021122.jpg
FlightRadar24.com
us customs computers down schiavo security sot _00021122.jpg
Now playing
02:22
Airport computer outage disrupts customs
DENVER - NOVEMBER 22:  Air travelers move through a main security checkpoint at the Denver International Airport on November 22, 2010 in Denver, Colorado. The TSA is bracing for heavy traffic the day before Thanksgiving, as two separate internet campaigns are promoting a "National Opt-Out Day" protest during which travelers are urged to "opt out" of the new body scanners because of concerns over privacy and possible exposure to radiation. Those passengers who refuse the scans must instead undergo an enhanced pat down by TSA agents, which could further slow down security lines on the busiest air travel day of the year.  (Photo by John Moore/Getty Images)
John Moore/Getty Images
DENVER - NOVEMBER 22: Air travelers move through a main security checkpoint at the Denver International Airport on November 22, 2010 in Denver, Colorado. The TSA is bracing for heavy traffic the day before Thanksgiving, as two separate internet campaigns are promoting a "National Opt-Out Day" protest during which travelers are urged to "opt out" of the new body scanners because of concerns over privacy and possible exposure to radiation. Those passengers who refuse the scans must instead undergo an enhanced pat down by TSA agents, which could further slow down security lines on the busiest air travel day of the year. (Photo by John Moore/Getty Images)
Now playing
01:42
TSA changes rules for airport security screenings
Erin Fooch was flying out of O'Hare Airport Friday morning and her wait time to get through TSA was 2 hours.  She just made her flight, but her boss wasn't so fortunate.
Erin Fooch
Erin Fooch was flying out of O'Hare Airport Friday morning and her wait time to get through TSA was 2 hours. She just made her flight, but her boss wasn't so fortunate.
Now playing
00:47
TSA security lines frustrate travelers
pkg future of travel airport security innovation _00011922.jpg
pkg future of travel airport security innovation _00011922.jpg
Now playing
01:59
The future of airport security
ac pkg griffin airport security gaps exposed _00013617.jpg
ac pkg griffin airport security gaps exposed _00013617.jpg
Now playing
06:23
Investigation reveals serious gaps in airport security
Scott Olson/Getty Images
Now playing
02:54
TSA warns of hard-to-detect bombs
CHICAGO, IL - SEPTEMBER 19: United Airlines jets sit at gates at O'Hare International Airport on September 19, 2014 in Chicago, Illinois. In 2013, 67 million passengers passed through O'Hare, another 20 million passed through Chicago's Midway Airport, and the two airports combined moved more than 1.4 million tons of air cargo. (Photo by Scott Olson/Getty Images)
Scott Olson/Getty Images North America/Getty Images
CHICAGO, IL - SEPTEMBER 19: United Airlines jets sit at gates at O'Hare International Airport on September 19, 2014 in Chicago, Illinois. In 2013, 67 million passengers passed through O'Hare, another 20 million passed through Chicago's Midway Airport, and the two airports combined moved more than 1.4 million tons of air cargo. (Photo by Scott Olson/Getty Images)
Now playing
01:16
Pilot removed from flight after rant
Esteban Santiago
Esteban Santiago
Now playing
02:21
Airport attack suspect had gun in checked bag
Now playing
02:06
U.S. increases security measures at airports
Now playing
01:51
TSA reveals plan to reduce wait times
	LOS ANGELES, CA - MAY 02: Transportation Security Administration (TSA) agents screen passengers at Los Angeles International Airport on May 2, 2011 in Los Angeles, California. Security presence has been escalated at airports, train stations and public places after the killing of Osama Bin Laden by the United States in Abbottabad, Pakistan. (Photo by Kevork Djansezian/Getty Images)
Getty Images
LOS ANGELES, CA - MAY 02: Transportation Security Administration (TSA) agents screen passengers at Los Angeles International Airport on May 2, 2011 in Los Angeles, California. Security presence has been escalated at airports, train stations and public places after the killing of Osama Bin Laden by the United States in Abbottabad, Pakistan. (Photo by Kevork Djansezian/Getty Images)
Now playing
02:27
How effective are TSA's screening methods?
new airport security measures dnt marsh lead_00004615.jpg
new airport security measures dnt marsh lead_00004615.jpg
Now playing
01:25
Heightened security at airports
Travelers wait for screening at a special TSA Pre-check lane at Terminal C of the LaGuardia Airport on January 27, 2014 in New York City. Once approved for the program, travelers can use special expidited Precheck security lanes. They can also leave on their shoes, light outerwear and belt, as well as keep their laptop and small containers of liquids inside carry-on luggage during security screening. The TSA plans to open more than 300 application centers across the country. (Photo by John Moore/Getty Images)
John Moore/Getty Images
Travelers wait for screening at a special TSA Pre-check lane at Terminal C of the LaGuardia Airport on January 27, 2014 in New York City. Once approved for the program, travelers can use special expidited Precheck security lanes. They can also leave on their shoes, light outerwear and belt, as well as keep their laptop and small containers of liquids inside carry-on luggage during security screening. The TSA plans to open more than 300 application centers across the country. (Photo by John Moore/Getty Images)
Now playing
01:12
GAO: TSA screenings may not be effective

Story highlights

The incident happened at around 2:20 p.m. local time

Four people were hurt, while the attacker is in critical condition

NEW: Police identify attacker as migrant worker with gambling debts

(CNN) —  

Four passengers were wounded after a man hurled an explosive device at a check-in counter at Shanghai’s Pudong International Airport on Sunday afternoon, before attempting to kill himself.

“According to the initial police investigation, a man took out a homemade explosive device in a beer bottle from a bag he was carrying and threw it in front of the check-in counters.

“After the beer bottle exploded, the man took out a dagger from his bag, slashed his own neck and collapsed on the floor,” according to a Shanghai Police press statement.

On Monday, police identified the suspect as Zhou Xingbai, a 29-year-old man originally from the southwestern province of Guizhou.

Police said Zhou took several buses to make his way to the Pudong airport on Sunday and committed the crime around 2:26 p.m. near check-in row C at Terminal 2.

According to the preliminary investigation, Zhou filled a beer bottle with gunpowder from fireworks and firecrackers. Police said they have found remnants of gunpowder in his residence in Kunshan, near Shanghai.

The assailant is currently in critical condition and being treated in hospital, police said.

Another four passengers at the scene – including a Filipino national – were slightly injured by broken glass from the blast and have been hospitalized for treatment. The case is under further investigation, the police statement added.

Armed troops inside Pudong airport seal off part of the arrivals terminal.
STR/AFP/AFP/Getty Images
Armed troops inside Pudong airport seal off part of the arrivals terminal.

After graduating from high school in 2006, Zhou became a migrant worker - first in the southern province of Guangdong and later in the eastern province of Jiangsu, according to the police statement.

’Lost all his savings’

He has been a worker at an electronics factory in Kunshan since early 2014 and has lived in the employee dormitory.

“After Zhou became addicted to gambling, he had lost all his savings and depended on borrowing money from friends to survive,” police said.

“Before the incident, Zhou said in a group chat on Wechat (social media platform) that he had owed many people money and was ready to do something so crazy that he would lose his life for it.”

Pudong is one of China’s busiest aviation hubs, with more than 60 million passengers passing through its two terminals last year.

Beijing blast

In 2013, a wheelchair-bound man set off a homemade explosive inside Beijing Capital International Airport after being prevented from airing a personal grievance.

According to Xinhua, he was stopped from handing out leaflets “to get attention to his complaints” outside the arrival hall. He then warned people nearby to get away before setting off the device.

He was sentenced to six years in prison.

CNN’s Yuli Yang contributed to this report.