The head of the WHO, Dr Margaret Chan, called it one of the greatest public health achievements possible.
It follows years of efforts to give pregnant women early access to prenatal care, testing and drugs to stop these diseases passing from mother to child.
The WHO hopes other countries will be able to achieve the same.
Every year, globally, around 1.4 million women living with HIV become pregnant.
Untreated, they have a 15-45% chance of transmitting the virus to their children during pregnancy, labour, delivery or breastfeeding.
That risk drops to about 1% if antiretroviral medicines are given to both mothers and their babies.
And each year, nearly a million pregnant women worldwide are infected with syphilis.
Again, early screening and treatment of these women can avoid complications for their unborn children.
In Cuba, according to the available official data, less than 2% of children whose mothers have HIV are born with the virus – the lowest rate possible with the available prevention methods.