Cuban right-handed pitcher Yoan Lopez agreed to a contract with the Arizona Diamondbacks on Tuesday. The deal includes $8.27million signing bonus.

The deal is pending a physical. The $8.27 million bonus is the largest for a young player who lives outside the U.S., Canada, and Puerto Rico. Under baseball’s collective bargaining agreement, the bonus is subject to the Diamondbacks international signing pool, the Associated Press reports.

The signing could be very costly to the Diamondbacks. The Diamondbacks will be subject to a 100 percent tax on the amount they exceed in their bonus pool and will not be allowed to sign any international players for more than $300,000 during the next two signing periods, according to USA Today. Diamondbacks general manager Dave Stewart isn’t concerned about spending however, saying that they will have $5.4 million to spend in the 2015-16 signing period.

"We feel that he's capable of competing right now for a spot in our rotation," Stewart said. "With us also having the first pick in the draft, it's almost like we get two first picks."

Lopez, 21, has established residency in Haiti, and Major League Baseball declared him a free agent last year. In November he had a showcase for all teams, then private workouts afterwards. The Los Angeles Dodgers, New York Yankees, and Cincinnati Reds were among the teams that expressed interest in signing Lopez. Lopez played for Isla de la Juventud in Serie Nacional in Cuba for three years. He had a 3.12 ERA with 28 strikeouts and 11 walks in 49 innings last year, according to MLB.com. He defected from Cuba at the end of the season last year.

Lopez isn’t the only Cuban player to sign with the Diamondbacks. Last month they signed Cuban outfielder Yasmany Tomas to a six-year, $68.5 million deal. Lopez is expected to start his career with the Diamondbacks in the minor leagues, but will be invited to spring training.

The Diamondbacks had the worst record in baseball last year.