Chief medical officer Dr SP Chaudhary said the matter came to light after the health department launched an investigation following reports of "high number of HIV cases" in the area.
"Seeing the high number cases, the health department constituted a two-member committee which visited various settlements of Bangarmau to investigate the reasons behind the spike," he said.
Mr Chaudhary said the team visited Premganj and Chakmirpur areas of Bangarmau and filed a report, based on which screening camps were held at three places (in Bangarmau) on January 24, January 25 and January 27.
"In the camps, 566 people were examined of whom 21 were found to be infected with HIV," the chief medical officer said.
A case against the quack has been registered in Bangarmau police station, the chief medical officer said. He said the patients have been referred to Antiretroviral Therapy (ART) centre in Kanpur.
ART consists of a combination of antiretroviral (ARV) drugs to maximally suppress the HIV and stop its progression. ART also helps prevent onward transmission of HIV, he said.
Speaking about the incident, Uttar Pradesh Health Minister Siddharth Nath Singh told reporters, "We are investigating the matter and a thorough mapping is being done. Anyone who sells injections without a proper license will be investigated."