New York (CNN) -- Major League Baseball issued a policy Tuesday afternoon to protect players from discrimination and harassment based on their sexual orientation.
MLB Commissioner Bud Selig and New York Attorney General Eric T. Schneiderman announced the new code of conduct at an All-Star game fan celebration at New York's Javits Center.
The policy aims to strengthen efforts to protect gay players. The code will be given to every Major League and Minor League player and posted in each locker room.
"The Great American pastime of baseball sends a message that no professional athlete, professional or amateur should have to sit on the sidelines or hide out of fear of being mistreated because of their sexual orientation," said Schneiderman. "I commend the commissioner and Major League Baseball for leading the charge for tolerance in professional sports."
The poster defines harassment and discrimination as slurs and insults, unwelcome physical contact and pornography on bulletin boards and locker rooms. The league will also put into effect a complaint system for reporting harassment and discrimination incidents.
In addition, Selig's office will organize training sessions for club and league officials and staff at industry meetings. The next meeting is scheduled for November.
"The new policy is not in response to any specific incident," said Andrew Friedman, deputy communications director for Schneiderman.
Baseball isn't the only sport addressing the issue of discrimination.
In April, Schneiderman announced an agreement to reinforce anti-discrimination policies with the National Football League to "promote a culture of inclusion" and help disseminate posters to all 32 teams in the league.
The NFL's policy came after earlier reports that indicated at least three prospective NFL players were asked about their sexual orientation during the league's national recruitment Scouting Combine in February, according to a Schneiderman press release.
According to one prospect, representatives of the NFL teams asked the athletes whether they had a girlfriend, were married or liked girls, according to the press release. The new NFL policy, implemented in April, dictates that questions during interviews and recruitment "must not seek information concerning personal information based on a player's sexual orientation," according to the NFL workplace conduct poster.
"It's been an ongoing conversation with clubs and players we've met over the years to help shape our plan and policies," said Brian McCarthy, vice president of corporate communications for the NFL.
In the past, sports leagues have handled homophobia in different ways. In 2006, MLB manager Ozzie Guillen referred to a reporter by a homophobic slur and was asked to issue an apology.
In 2012, Toronto Blue Jay's short stop Yunel Escobar was suspended three games by Major League Baseball after wearing a homophobic slur on his eye black during a game. In June, Indiana Pacers player Roy Hibbert used the term "no homo" during a press conference. Hibbert was fined $75,000 and issued an apology via Twitter to Jason Collins, who had recently become the NBA's first openly gay athlete.
Human rights organizations welcomed MLB's move and its possible future impact.
"What we have been seeing is a greater move towards acceptance on the basis of sexual orientation, and we have seen the MLB showing leadership in this area," said Michael Cole-Schwartz, director of media relations for the Human Rights Campaign.
Changes in policy may be difficult to implement at first, especially for athletic organizations, but Cole-Schwartz believes that these changes will show benefit over time.
"It says to gay fans and any players that might be gay but not out yet that the league is taking their concerns seriously and that it is a safe environment in which to enjoy and play the sport," said Cole-Schwartz.