PHOENIX -- Two children have been taken to the hospital after being struck by a bat and a ball at Monday's game between the Arizona Diamondbacks and San Francisco Giants.

A 13-year-old boy seated near Arizona's dugout just beyond the start of the protective netting, was hit on the right side of the head in the fourth inning after San Francisco's Buster Posey lost the bat swinging at a pitch.

In the next at-bat, the Giants' Pablo Sandoval sent a foul ball into the upper deck, where it struck a 2-year-old girl on the forehead.

Medical personnel rushed to the boy and started applying pressure and a cold compress to the side of his head for several minutes. He was later fitted with a neck brace and strapped to a stretcher.

The boy was alert and speaking with medics as they worked on him and gave a thumbs-up to the crowd as he was carried away. A security official at Chase Field said he was taken to a hospital as a precaution.

"I felt terrible, obviously," Posey said. "Somebody told me he left thumbs up, so I wish him the best. Hopefully, everything's all right."

The girl also was taken to the hospital.