"Real Madrid and Flamengo have reached a deal for the transfer of Vinicius Junior from July 2018," a statement published on the Flamengo site said.
Madrid said the pacy striker will remain at Flamengo until July 2019 unless both sides agree he can move earlier.
Although the clubs did not say how long his contract was for or how much the fee was, reports in Spain suggest Madrid would shell out around 46 million euros ($51.45 million), which would make him the second most expensive signing from the Brazilian league.
Vinicius, who will turn 17 in July, only made his first-team debut for the Rio club 10 days ago but his decisive performances for Brazil’s Under-17 side singled him out as one of the game's hottest prospects.
He is expected to lead Brazil in India in October at the Under-17 World Cup. ($1 = 0.8941 euros)