In a post in Spanish to Instagram on Tuesday, Castro wrote that he was attacked by two people who robbed him of his chain.
"Thank God that their gun got jammed," a translation of the post read. "I'm alive by the mercy of God.
"This has to stop. They took my chain and they wanted to kill me. It's unbelievable, I was at a training field trying to help those who want to make it to the big leagues and these two guys jumped on me to take my chain with also the intention of putting a bullet in me. This has to stop."
In a statement, Orioles general manager Mike Elias said the team has been in contact with Castro and is "very thankful that he is safe."
The agency that represents Castro issued a statement, saying: "Miguel is safe. He is shaken. He feels extremely blessed and fortunate to still be alive and thanks everyone for their support. He will continue to use his platform to be a role model."
Castro broke into the majors in 2015 with the Toronto Blue Jays. The right-hander spent the past three seasons with Baltimore, and he went 1-3 with a 4.66 ERA in 65 appearances in 2019.