The family friend killed 61-year-old Satyavathi Venna while trying to abduct the girl, whom he planned to hold for ransom, Montgomery County District Attorney Risa Vetri Ferman said.
"The grandmother died trying to save her granddaughter's life, trying to prevent her from being taken," Ferman said.
Ferman identified the suspect as Raghunandan Yandamuri, 26. He lives in the apartment complex and was acquainted with the family as a member of the Indian community.
Yandamuri was being arraigned Friday afternoon. It wasn't clear if he had an attorney.
Ten copies of a ransom note were left in the apartment. It demanded $50,000 in exchange for the girl's safe return, Ferman said.
"It was clear it was crafted by someone who knew the family nicknames," Ferman said.
Yandamuri led investigators to the girl's body, according to Ferman. He told investigators he stuffed a handkerchief into the girl's mouth and wrapped a towel around her head before putting her in a suitcase as part of the kidnapping, she said.
An autopsy was being conducted on the girl. Ferman said her body had been found under a bench in a sauna or bathroom area.
Upper Merion Township police say the girl's father and mother moved to the U.S. from India in February 2007 and into the apartment in June.
Ferman said there was no indication Yandamuri knew the family before they arrived in the area. He had participated in a candlelight vigil held for the missing girl and distributed fliers about her, Ferman said.
The grandmother had been visiting from India since July and was scheduled to return home in January. She died of cuts to her neck and chest, a coroner said.