ATLANTA — Julio Teheran was unable to end his winless streak against Miami, even when handed a three-run lead through five innings.

Teheran gave up four runs and the lead in the sixth as the Atlanta Braves lost to the Marlins 7-5 on Wednesday night after the benches emptied in a testy game.

Teheran (5-10) lost a 4-1 lead in the sixth, when he gave up a three-run homer to Marcell Ozuna.

“I had control of the whole game until that last inning,” Teheran said.

“I was trying to keep up the same pace but I made one mistake in that inning with two men on base and they got the lead. We lost the game right there.”

Teheran is 0-3 with a 4.79 ERA in his last six games against Miami, a stretch that began in May 2015.

The benches for both teams emptied in the seventh after Atlanta reliever Jose Ramirez threw high and inside to Marlins ace Jose Fernandez, who had been knocked to the ground by a pitch from Teheran in the fifth.

No punches were thrown and Ramirez was ejected.

Tensions began to rise in the sixth. Fernandez hit Nick Markakis on the hip with a fastball after Teheran plunked Martin Prado in the top of the inning. Both teams said no warning was issued by plate umpire Marvin Hudson before he tossed Ramirez.

Teheran said a curveball slipped out of his hand on his inside pitch to Fernandez in the fifth.

“If I’m going to hit somebody, I’m not going to hit him with my curveball,” Teheran said. “If I’m going to move somebody off the plate, I’m going to do it with my fastball.”

Fernandez also insisted he was innocent, saying he didn’t try to hit Markakis, who clocked a two-run homer in Atlanta’s four-run second.

“The ball slipped out of my hand and I hit him,” Fernandez said.

Fernandez pointed to his ribs when he added: “If you think it’s on purpose and you want to hit me, good, hit me. I don’t mind. That’s part of baseball. But don’t throw at somebody’s head, because I have a family.”

The comeback from a 4-1 deficit helped Fernandez (15-8) stop a five-game road losing streak, the longest of his career.

Ozuna drove in four runs on two hits, including a run-scoring single off Mauricio Cabrera in the eighth.

A.J. Ramos pitched around a one-out double by Jace Peterson in the ninth for his 36th save.

OH, BABY!

Freddie Freeman’s third-inning single for Atlanta gave him a 20-game hitting streak, the longest active run in the majors. It matched a 20-game string in 2011 as the longest of his career. He has reached base in 36 consecutive games since Aug. 6.

Freeman left the game early after receiving a message his wife was about to give birth.

BRAVES ADD 2 ARMS

The Braves, looking for pitching depth after recent injuries to Williams Perez and Mike Foltynewicz, acquired veteran right-handers Josh Collmenter and Joe Wieland in separate deals with the Chicago Cubs and Seattle Mariners.

Collmenter, 30, was acquired for cash and could start on Saturday against Washington. After being released by Arizona on Aug. 7, he signed a minor league deal with the Cubs and had a 2.25 ERA in four starts with Triple-A Iowa. He was Arizona’s opening day starter in 2015.

Atlanta will send cash or a player to be named to Seattle for Wieland, who will report to Triple-A Gwinnett.

TRAINER’S ROOM

Perez, who left Sunday’s loss to the Mets, has a right elbow impingement and might be done for the season. Interim manager Brian Snitker said Perez will be shut down “and let everything calm down” before he starts throwing again. … Snitker hopes Foltynewicz, hit on his calf by Ozuna’s liner on Monday, misses only one start. The Braves are looking for a Saturday starter against Washington.

UP NEXT

Marlins: RHP Tom Koehler (9-11, 3.97 ERA), who has lost his last three decisions, will look to continue his success against the Phillies on Friday night in Philadelphia. Koehler is 2-1 with a 1.29 ERA in four starts against the Phillies this season.

Braves: Rookie RHP John Gant (1-3, 4.39), who has lasted at least five innings in only two of his six starts, will look for his first win since June 17 against Washington in Friday night’s opening game of a weekend series.