The Montenegro Under-20 international, who has featured at the under-19 level, posted a photo of the contract signing on Instagram.
The teenager's agent, Ramir Radoncic, is friendly with Manchester City manager Pep Guardiola, which reportedly helped result in a trial for the keeper while Guardiola was at Bayern Munich in 2015.
SPORT reports Guardiola and Manchester City made a late run at the keeper.
Carevic has been the starter the last two seasons as Montenegro first division side OFK Grbalj. He will join Barcelona’s top youth side, the Juvenil A team, and is expected to be a regular starter.
The 6-foot-4-inch goalkeeper will be hoping to impress in the youth team and perhaps make his way into the senior squad following the appointment of Ernesto Valverde as Barca's new manager.