NEW YORK -- The Yankees believe that they significantly improved their chances of securing championship No. 28 on Monday, pulling off one of the afternoon's biggest moves by acquiring right-hander Sonny Gray from the Athletics in exchange for three top prospects.

With about an hour remaining before the 4 p.m. ET non-waiver Trade Deadline, the Yankees agreed to swap outfielder Dustin Fowler , infielder Jorge Mateo and right-hander James Kaprielian to the A's in exchange for the 27-year-old Gray, widely viewed as one of the top available starters in the marketplace.

"On behalf of this fan base, this team has shown it's got the ability to allow us to push a lot of these chips in the middle of the table and recognize 2017 has a chance to be special," Yankees general manager Brian Cashman said.

• Six reasons Yankees fans should be excited

Fowler, Mateo and Kaprielian were ranked as the fourth-, eighth- and 12th-best prospects, respectively, in the Yankees' farm system by MLBPipeline.com. The Yanks are also receiving $1.5 million in international bonus pool money.

Gray will be joining a Yankees club that, with a 57-47 record, holds a half-game lead over the Red Sox in the American League East after Monday's 7-3 victory over the Tigers.

"We kind of went back to our same old Yankees -- the goal is to win the World Series," Carsten Sabathia said. "We're here now."

Manager Joe Girardi said that Gray will make his first start for the Yanks during the team's upcoming road trip, which begins on Thursday at Cleveland. Gray's arrival will shake up the rotation, as Girardi said that he will not use six starters. The odd man out could be Jordan Montgomery , who lasted just 2 2/3 innings in Sunday's 5-3 loss to the Rays.

"I think we've definitely improved ourselves," Girardi said. "When I look at ownership and the front office, they've given us an opportunity to do something special here. Now we have to go out and do it."

Gray was 6-5 with a 3.43 ERA in 16 starts this season, and serves as a long-term acquisition. Earning $3.575 million this year, he is eligible for salary arbitration for two more seasons beyond this one, meaning he is not eligible for free agency until after 2019.

"Any time you're able to make a move and get better, not just for the present but for the future as well, I think it's exciting," Brett Gardner said. "We've got two important months coming up and a lot of baseball left to play, but I like where we're at right now, and I like the team that we have."

Oakland's first-round selection (18th overall) in the 2011 Draft, Gray was 4-2 with a 1.37 ERA over his final six starts with the club. He finished third in the 2015 AL Cy Young Award voting, going 14-7 with a 2.73 ERA and 1.08 WHIP in 208 innings and was named to the AL All-Star team. Gray was 44-36 with a 3.42 ERA in 114 games (112 starts) over parts of five seasons with the A's (2013-17).

"I know that he's somebody that can slide into any rotation and automatically make the team better," Gardner said. "He's somebody that I think we're all excited to get to know. We're excited to get him over here and work alongside him. I think he's going to be a big boost for us."

Although the Yankees were widely viewed as the front-runners to land Gray, Cashman had refused to part with outfielder Clint Frazier and infielder Gleyber Torres . The A's also coveted outfielder Estevan Florial, another leading prospect, but were rebuffed.

Fowler and Kaprielian are out for the season, though both are expected to return in 2018. Fowler's Major League debut was cut short by a knee injury on June 29 against the White Sox, and Kaprielian -- New York's first-round Draft pick in 2015 -- had Tommy John surgery in April.

"These guys are going to come back, they're going to be good, and they're going to be good for a long time," Cashman said. "But it's an area of strength. Our system [is strong], as we've all noted, and obviously the Trade Deadline last year made it deeper."

The speedy Mateo has split the season with Class A Advanced Tampa and Double-A Trenton, combining to bat .258/.318/.438 with eight homers, 37 RBIs and 39 stolen bases in 99 games.

"To get a really good player, you're going to have to give up good players," Girardi said. "We gave up three really good prospects, but in return we got a really good pitcher. And it's not just a rental. It's a pitcher that we'll have under control for 2 1/2 years."

Cashman has been the Yankees' GM since 1998, and Billy Beane has been in charge of Oakland's baseball operations since 1997, making them two of the longest-tenured executives in the game.

But the Yanks and A's have made just four trades during those overlapping tenures, and the most recent one of consequence was 15 years ago. It was a three-team swap on July 5, 2002, in which the primary pieces were Jeff Weaver (sent from Detroit to New York), Ted Lilly (New York to Oakland) and Jeremy Bonderman (Oakland to Detroit).

"We just have not matched up, despite being close," Cashman said. "I think we've liked the same players. We think probably very similarly, and that doesn't create an atmosphere of matches as easy."

The deal capped a busy month for Cashman's Yankees, who acquired Todd Frazier , Tommy Kahnle and Player Page for David Robertson from the White Sox on July 18, then picked up left-hander Jaime Garcia from the Twins on Sunday. Earlier on Monday the Yanks shipped right-hander Yefry Ramirez to the Orioles in exchange for international signing bonus pool money.

"You react to what you see," Cashman said. "We had to react to what we'd seen last year, and we're reacting to what we're seeing this year. Hopefully, these guys are excited. I know we're excited we have a shot. And that's all you can do."

Fantasy spin | Fred Zinkie (@FredZinkieMLB)

Having posted a 1.48 ERA during July, Gray joins the Yankees in top form. Backed by a deep bullpen and an offense that ranks fourth in the Majors with 550 runs scored, the right-hander could win plenty of games down the stretch. However, he might also see a small bump in his 3.43 ERA due to his new hitter-friendly home park. Meanwhile, the arrival of Gray could push rookie Montgomery (4.15 ERA, 8.5 K/9 rate) to New York's bullpen -- and the waiver wire in mixed leagues.