US President Donald Trump has repeatedly sought to exert pressure on Cuba and has openly discussed toppling its communist regime.
On Thursday, Chinese foreign ministry spokesman Guo Jiakun said the US should "stop threatening force at every turn", and that Beijing "firmly supports Cuba".
On Wednesday, Castro was charged alongside five others of involvement in the shooting down of two planes travelling between Cuba and Florida three decades ago, and was indicted with offences which carry penalties of life in prison or death.
The aircraft, which were operated by the Cuban-American dissident group Brothers to the Rescue, were carrying three US citizens when they were downed, all of whom were killed.
At the time, Castro - who stepped down as president in 2018 - was head of the country's armed forces.
The incident caused outcry among Cuban exiles living in the US and has long been a source of contention between Washington and Havana.
Cuba's president Miguel Díaz-Canel has described the charges as "a political manoeuvre, devoid of any legal foundation".
The foreign minister of China, a long-standing supporter of Cuba, said Beijing opposed "any attempt by external forces to exert pressure on Cuba under any pretext".