Jesús Díaz, a 61-year-old prediabetic, had waited months to secure an appointment at a coronavirus vaccination site in the Rio Grande Valley region.

But when the undocumented Mexican immigrant got to the front of the line of the University of Texas Rio Grande Valley’s vaccination clinic last weekend after a four-hour wait, a staffer told him he was out of luck.

“Vaccines here are exclusive for American citizens and legal residents of this country,” Díaz recounted a staff member telling him. “We can’t help you. I’m so sorry, but these are the rules.”

Proof of residency and citizenship are not required to receive a vaccine dose in Texas. But Díaz feared staff members might call immigration authorities if he caused a scene, so after briefly arguing, he gave up his place in line and left without a shot.

Díaz wasn’t alone. At least 14 people have been wrongly turned away from the university’s vaccination sites because of their residency or immigration status, a university spokesman told The Post, illustrating one of the many barriers undocumented Americans face in getting vaccinated. Health experts say a flood of misinformation has targeted the undocumented community, which also faces lingering fears that authorities might check their immigration status at clinics.

The university has since apologized for denying vaccine doses to Díaz and other eligible patients, adding that its staff was given incorrect instructions on how to interpret the state’s guidance.

“We know you expect better from us, and we are deeply sorry for failing to uphold our standard of excellence at a time when our community needs us most,” John H. Krouse, the dean of the university’s school of medicine, said in a Thursdaystatement.

The U.S. government has promised undocumented immigrants will have the same access to coronavirus vaccines as citizens or legal residents. It has also pledged inoculation sites will be immigration-enforcement-free zones.

But some states have already contradicted the Biden administration’s stance on the issue. Last month, Nebraska Gov. Pete Ricketts (R) came under fire after saying he did not expect undocumented immigrants working at meatpacking facilities to get vaccinated under the state’s program. Soon after, an aide for Ricketts clarified his comments by noting those without legal status would have to wait in the back of the line.

Díaz, a mechanic and a welder who has lived in Texas since 1996, said his son Abraham Díaz registered him for a vaccine in late November. He constantly asked for updates, Abraham, 28, told The Post, but for weeks the answer was always the same: not yet. But on Feb. 16, an email notifying his father that he was now eligible interrupted the family’s dinner in their San Juan, Tex., home.

“He didn’t think about it twice,” Abraham told The Post. “He didn’t care if it was in another city. He was willing to travel, to wake up early, to go at night. He was practically going to put anything he had to do on hold to get vaccinated.”

So Abraham booked an appointment last Saturday at 8 a.m. at the University of Texas Rio Grande Valley’s site in their town, which sits along the southern border.

That morning, Díaz arrived about a half-hour early with a printed copy of his appointment confirmation, his passport and a bank statement with his home address. He filled out some forms and waited hours in line for his turn.

Then, at around noon, he called his son to tell him that a staffer had asked him for his Social Security number and then refused to give him a shot because he was not an American citizen or a legal resident.

“He wanted to tell them right there that it was a lie that only citizens could [get a vaccine]," Abraham said. “but he knew ... they could call immigration because he had already disclosed that he didn’t have documents.”

When Abraham couldn’t find anything about a citizenship requirement on the university’s website, he took to social media.

“After being in line [for] 4+ hours, @utrgv denied my father the coronavirus vaccine because he’s undocumented. He’s 60+ with underlying conditions. They said their website mentions it but it’s a lie,” he tweeted. “@utrgv what is your response to this??”

Díaz said a representative with the university called him two days later to apologize and claimed that he had been turned away because the site ran out of vaccines. He says they have called him about six other times this past week to offer him another slot for a shot.

But Díaz said he no longer wishes to return to that site after the humiliating episode.

“I really don’t want to go there,” he said. “I’m ashamed to go back. I want to look for another option where the same thing won’t happen to me again.”

On Wednesday, the university posted a public notice promising that “no eligible individual would be denied a vaccine by UT Health RGV based on the individual’s residency or immigration status.” The university also encouraged anyone who was previously denied the vaccine because of residency or immigration status to contact the school to reschedule their appointments.

The following day, Krouse acknowledged the university had made some “critical mistakes” at their vaccination sites. The university, he added, has since apologized to those who have been affected and has begun rescheduling their appointments.

Díaz said he hopes his story can teach other undocumented immigrants that if they speak up against injustices, they have an opportunity to change things.

“Make your voice heard and don’t be afraid,” he said.