A friend of former Red Sox first baseman Hanley Ramirez dropped his name in an effort to avoid arrest while transporting fentanyl from New York to Massachusetts in April, then immediately admitted the player had no connection to the drugs, according to documents filed in US District Court in Boston.

Ramirez is not under federal investigation and has not been linked to any drug ring, according to several people with direct knowledge of the case. The 34-year-old has been a free agent since the Red Sox released him on June 1.

An attorney, who represents the man arrested with the drugs and spoke on the condition that his client not be named because of concerns about his safety, said his client grew up in the Dominican Republic with Ramirez and used his name “to get the cops off his back, which didn’t work.”

The man was stopped by State Police in western Massachusetts in April after a confidential informant tipped the Drug Enforcement Administration that he would be delivering two kilograms of cocaine to Massachusetts, according to a DEA affidavit filed in court.