WAS I WRONG FOR THIS?!!?!!? (please read)

Okay so we were swimming at the lake and my niece who is 3 was in the floaty. My mom was watching her so me and my sister could swim for a few minutes. I turned and looked and took a few steps to see what was going on. She started tipping forward and I lunged to her. She fell out and was struggling for air. I grabbed her by the armpits to push her up (I wasn’t standing. I didn’t even try because her getting to safety was my priority) my mom grabbed her arm and she slipped out of her arm. She fell back into the water and I grabbed her arm with out thinking and pulled her to me. Then swooped my arm under her to push her up. Once I safely had her above water. My mom came behind me while my niece was sitting on my nieces and arms keeping her above water, slapped me across the back of my head. I was stunned. Then blamed me telling me I was drowning her even if it wasn’t by accident (her head dunked under water for a second when I pulled her to me) and made my niece think I was trying to hurt her. Was I wrong for this? All I did was try to save a child that was drowning.