CVS has apologized for denying a 20-year-old Puerto Rican student cold medicine at a store in Indiana because employees did not believe his driver’s license was a valid form of identification.

José A. Guzmán-Payano, a junior at Purdue University, went to a store near his dorm in West Lafayette, Ind., on Oct. 25 to buy Mucinex for a cold, his mother wrote on Facebook. When an employee at the checkout saw his Puerto Rican driver’s license, she asked him for a visa, and “started confronting him about his immigration status,” Arlene Payano Burgos wrote in a post that had been shared more than 10,000 times.

Mr. Guzmán-Payano had to explain that, in fact, Puerto Ricans are American citizens. But the employee still would not accept the license or a United States passport that he showed her. A manager also refused to sell him the medicine.

In a phone interview, Mrs. Payano, a legal secretary in Cayey, Puerto Rico, said that not being able to help her son was deeply frustrating. After he told her what had happened, she called the store and was also told not accepting Puerto Rican identification was store policy.