There are the homeless, those living hand to mouth on the streets, and then others with barely enough cash to spare to spend the night in an Internet cafe.

A survey by the Tokyo metropolitan government, the first of its kind, estimated the capital has around 4,000 so-called Internet cafe refugees.

More than 50 percent of them took shelter in cybercafes and similar facilities after losing their jobs or retiring from work.

Nearly 90 percent are employed, but most of them are not on regular contracts.

The metropolitan government contacted 502 cybercafes, capsule hotels and other facilities in Tokyo and questioned 1,000 patrons and others between November 2016 and the following January.

Based on the results, it was estimated that 15,300 individuals stay overnight at cybercafes and elsewhere on weekdays. As one-quarter of the respondents said they do not have homes to go to, the figure of 4,000 Internet cafe refugees emerged.

Of the total, 363 Internet cafe refugees gave a detailed rundown of their circumstances through interviews or questionnaires.

Ninety-eight percent of them were men, and those in their 30s comprised the largest portion at 39 percent. Those in their 50s and 40s accounted for 29 percent and 17 percent, respectively.

Forty-four percent said they “sometimes spend the night at stations or on the street.”

Asked why they became homeless, 33 percent said they “cannot afford to pay the rent after quitting their job,” and 21 percent said they had “left the employee dormitory or other facilities after quitting their job.” Thirteen percent cited “a problem with their family.”

Although 87 percent said they were now working, 41 percent had only part-time positions and 40 percent were temporary employees dispatched by staffing agencies.

These unstable, temporary employment patterns accounted for 86 percent of the total.

Forty-seven percent of the respondents earned between 100,000 yen and 150,000 yen ($919 and $1,379) per month, while 13 percent said their monthly income hovered between 50,000 yen and 100,000 yen.

Referring to the findings, a metropolitan government official said Internet cafe refugees are becoming a diverse group because “some of them receive a certain wage level.”

Since 2008, the Tokyo metropolitan government has provided programs to help Internet cafe refugees find homes and employment.

It said the latest findings will spur it to consider more effective measures to help such individuals to find regular work.