The violence erupted on Tuesday night close to the breakaway region of Nagorno-Karabakh, an ethnic Armenian-controlled enclave in Azerbaijan.
The toddler, who was two, was named as Zahra Guliyeva.
Azerbaijan accused Armenia of targeting civilians. Karabakh officials said they had returned fire, accusing Azerbaijan of deploying weapons near civilians.
The two victims were buried beside each other just outside the village on Wednesday. The toddler's grandmother was named as Sahiba Allahverdiyeva, aged 51.
The two died when a shell hit a house in the village of Alkhanli in the Fizuli area of Azerbaijan on Tuesday evening. A second woman was wounded.
The foreign ministry in the Azerbaijan capital Baku said the village had been hit by mortar rounds and heavy grenade launchers.
Nagorno-Karabakh spokesman Senor Hasratyan expressed "pain and regret" at the toddler's death. However, officials accused Azerbaijan of positioning rocket launchers close to villages and said they had to take responsibility.
At the heart of the dispute surrounding Nagorno-Karabakh is a centuries-old dispute.
Both Armenians and Azeris consider the region to be theirs, culturally and historically. The mountainous enclave is about 4,400 sq km (1,700 sq miles).
Under the Soviets, the region was populated largely by ethnic Armenians, as an autonomous region within Azerbaijan. As the Soviet Union began to disintegrate, the ethnic Armenians sought unification with Armenia, which led to war in the 1990s.
Karabakh ceasefire deal announced
The conflict that refuses to go away
Ethnic Azeris fled Karabakh and Armenia while ethnic Armenians fled the rest of Azerbaijan.
Some 30,000 people died and hundreds of thousands of ethnic Azeris were displaced from the region and several other neighbouring areas. No peace deal has ever been signed and violence has flared up sporadically in recent years.
In April 2016, deadly clashes lasted for four days before a ceasefire was agreed.
Nagorno-Karabakh has never been recognised as independent by the international community, but it is backed by Armenia.
A young girl and her grandmother died when Armenian-backed troops shelled a village in Azerbaijan.