ATLANTA -- Derek Dietrich was having a career day at the plate on Sunday, but he wasn't able to fully enjoy it.

The Marlins' second baseman was involved in a scary situation in the ninth inning of a 7-3 win over the Braves. While sitting in the dugout, he was struck in the back of the head when Christian Yelich's line drive ricocheted off a wall in the dugout, according to manager Don Mattingly.

X-rays came back negative, but Dietrich will remain in Atlanta overnight for further evaluation, the team announced.

Dietrich, preparing to possibly bat in the inning, fell hard and was on the ground for several minutes, being tended to while the game continued. Dietrich, who didn't lose consciousness, sat up, then eventually got off the ground and walked into the clubhouse.

"You could tell everybody was a little frightened," Marlins infielder Chris Johnson said. "Usually after a win, you come in and it's loud. It's a scary thing. Guys were running into the training room to find out how he is."

"We'll find out more," Mattingly said. "The ball was coming in hot, and it probably gained speed off the wall."

Johnson was in front of Dietrich, and he initially feared the foul would strike him.

"I ducked out of the way. I thought the ball was going to hit me," Johnson said. "By the time I turned around, [Dietrich] was on the ground. Nobody knew what happened.

"It came right through the opening where you walk out. It was pretty hot. It hits the dirt once, hits the back of the dugout and smokes him on the back of the head."

Formerly with the Braves, Johnson said the Turner Field dugouts are usually pretty safe because of the high rails.

"This is even one of the better dugouts, because the screen is so big," Johnson said. "It's so tall. Usually, guys are just standing up there, and you can duck. It came right through that opening. You can't really do anything about it. It's not like you can put a door up there. It's just unfortunate, and we hope he's OK."

Dietrich, who belted a two-run homer and added a two-run double in the game, did not return to play second base in the bottom of the ninth. The four RBIs were a career high for him.

In the ninth, Miguel Rojas moved from shortstop to second to replace Dietrich. Adeiny Hechavarria, who was getting the day off, entered to play shortstop. Rojas is a likely replacement at second.

"You don't like seeing that happening to anybody, especially one of your teammates," Marlins right-hander Tom Koehler said. "Hopefully, it's just a headache, and he's back with us soon, and it's nothing serious."