Seeking to strengthen a weary bullpen, the Braves signed veteran right-hander Nick Masset to a free-agent contract Tuesday for the rest of the 2015 season.

The Braves opened a roster spot by optioning right-hander Cody Martin to Triple-A Gwinnett, and cleared space on the 40-man roster by designating for assignment right-hander John Cornely, who made his major league debut last month.

Martin will move into the Gwinnett rotation and be ready for any role — relief or starting — when the Braves need him again.

In his Braves debut Tuesday night, Massett pitched a perfect ninth inning with one strikeout in a 5-3 loss to the Rays.

Masset, 33, had a 1.86 ERA and .324 opponents’ average in eight appearances for the Marlins, allowing 12 hits, two earned runs and one walk with six strikeouts in 9 2/3 innings. He signed with the Braves one day after clearing waivers and electing to become a free agent.

“It developed pretty quick,” Masset said of signing with the Braves, against whom he pitched a scoreless inning Saturday in his last appearance for the Marlins. “Wasn’t sure what was going to happen, but to be picked up by the Braves, it’s a great opportunity for me. There’s a lot of history here.

“I grew up a Braves fan. I’m really excited to be able to help this ballclub win. There’s a lot of great guys in this clubhouse, and I’m feeling good. So I’m just excited to get back out here and keep competing.”

Masset had a “reverse split” going with the Marlins, holding left-handed hitters to a .190 average (4-for-21) and .217 on-base percentage with five five strikeouts, while right-handed hitters were 8-for-16 with only one strikeout.

“We did our homework and our scouts said this guy could be a tick upgrade,” Braves manager Fredi Gonzalez said. “The thing I like is he has six years of major league experience. And he had some really good numbers this year. We’re not bringing him in to make him the closer or eighth-inning guy. He’s a guy that can help us a little bit.”

Gonzalez noted that before optioning Martin to Triple-A, the Braves had three long-relief type guys in the bullpen with Martin and a pair of veterans, Trevor Cahill and left-hander Eric Stults, who were recently demoted from the starting rotation.

Martin, in his first major league stint, excelled for most of April, but posted a 7.88 ERA and .355 opponents’ average in his past seven appearances. In his final three appearances he got two losses and a blown save while allowing seven hits, five runs and two homers in three innings.

Masset had pitched five times in an 11-day span, allowing just three hits and no walks with three strikeouts in three scoreless innings in his last two appearances against the Dodgers and Braves before being DFA’d when the Marlins needed to clear a roster spot for Henderson Alvarez, who started Sunday’s series finale against the Braves.

“Yeah, I was a little surprised,” Masset said of being DFA’d. “I felt like I was throwing the ball really well. It comes down to business decisions, as we all know. I don’t really have a say. So it was a little disheartening for me, but at the end of the day we’re just players and we just go out and do what we’re supposed to do.

“Like I said, to be picked up by the Braves is kind of a dream come true for me, too, so I’m really excited to be here. We’ll just move forward and start putting up W’s.”

Masset had a 3.97 ERA (18-14 record) in 367 appearances over eight seasons with the Rangers, White Sox, Reds and Marlins. All but two of those appearances came out of the bullpen.

“Played with him Chicago — good arm, good guy,” Braves catcher A.J. Pierzynski said. “Wants the ball, takes the ball…. Guy that’s been in battles late in the game and had success, so that’s good.”

After posting a 3.71 ERA in 75 appearances with the Reds in 2013, Masset’s ERA climbed to 5.80 in 51 appearances for the Rockies in 2014.