There is a document in the National Historical Museum, in Argentina, that dates the invention of dulce de leche to 1829.
Juan Manuel de Rosas and his political enemy (and cousin brother) Juan Lavalle were about to meet to sign a pact of peace (Pact of Cañuelas) in Rosas' state, in the village of Cañuelas, just outside of Buenos Aires. Lavalle was the first to arrive and, fatigued, lay down on Rosas' cot and fell asleep.
Rosas' maid, while boiling milk with sugar (preparation known at that time as "lechada") to accompany the afternoon mate, found Lavalle sleeping on her employer's cot. She considered it an insolence and went to give notice to the guards.
A short time later Rosas arrived, who did not get angry with Lavalle and asked the maid for the mate with milk, who remembered at that moment that she had left the milk with sugar on the fire for a long time. When returning to look for the lechada, the maid found a thick, brown substance.
Its flavor pleased Rosas and it is said that he shared the sweet with Lavalle while discussing the fine points of the pact.