TAMPA, Fla. — Major League Baseball has told New York Yankees slugger Aaron Judge his comments attempting to recruit Baltimore shortstop Manny Machado violate the sport's tampering rules, and Judge says he has learned the lesson.

When the Yankees played the Orioles in Sarasota on Wednesday, Judge encountered Machado on the field before the game.

"Adding him to our lineup that we've already got, it'd be something special," Judge told reporters. "I told him, 'You'd look good in pinstripes.' "

Judge added: "He just kind of laughed it off. Didn't really say much."

Machado is eligible for free agency after this season, part of a class that includes Bryce Harper and Josh Donaldson.

Major League Baseball says in a statement: "We have been in contact with the Yankees. They communicated to us that Mr. Judge's off the cuff comments were not appropriate and not authorized by the club. They will speak to him to make sure that this does not happen again."

Judge and general manager Brian Cashman had a brief conversation about the matter.

"It just kind of came up in passing," Judge said Thursday. "Now I know. You learn something new every day."

Judge said the phone call from Cashman lasted about 30 seconds and the GM told him: "Here's a reminder that you can't do this and have a good night, and I said all right, see you tomorrow."

Cashman said he was called by Deputy Commissioner Dan Halem.

"Asked me to just politely talk with Aaron and remind him about the optics of that type of dialogue," Cashman said. "There were no bad intentions there. Simple conversions are more complicated when they play elsewhere, so he understands it."

Baltimore manager Buck Showalter said he was aware of the warning by the commissioner's office.

"I'm just glad they didn't catch Manny recruiting Judge," Showalter said.

Notes: Judge raised his average to .240 after going 2 for 2 in a 9-5 win over Pittsburgh Pirates. ... Gary Sanchez doubled, homered and had five RBIs ... Alex Rodriguez will make his debut as part of ESPN's new "Sunday Night Baseball" crew when the Yankees play Minnesota on March 22 in Fort Myers. ... INF Neil Walker is to play in his first spring training game with the Yankees on Friday night, four days after signing with New York. He is to start at first base. ... RHP Chance Adams was reassigned to the minor league complex.

___

More AP baseball: https://apnews.com/tag/MLBbaseball