Six attackers used 9 mm pistols to shoot at the people on the bus, police said.
After the attack, the bus was driven into a hospital parking lot with bullet holes riddled all along its side, said Salma Wahid, an official at the Memon Medical Institute Hospital in Karachi.
Most of the people in the bus were unconscious and splattered with blood, she said.
The vehicle was carrying men, women and children from the Ismaili Muslim community, said Ahmed Chinoy, chairman of the Citizen Police Liaison Committee in Karachi, Pakistan's largest and most populous city.
Ismailism is a Shiite sect. Unlike some other Shiite groups, Ismailis hadn't been heavily targeted by militants in Pakistan
"This is the first such incident of its kind towards the Ismaili community," said Zohra Yusuf, the chairman of the Human Rights Commission of Pakistan. "Nothing on this scale has ever been seen before."
Most victims shot in the head
The gunmen appeared to have been well-prepared for the attack. Most of the victims were shot in the head, said Pir Muhammad Shah, senior superintendent of police for East Karachi.
The attack was "disturbing in terms of the fact that the definition of who is a proper Muslim is shrinking as far as the extremist groups are concerned," Yusuf said.
Twenty-six males and 17 females were killed, said Sultan Ahmad, of the Memon Medical Institute Hospital in Karachi. The youngest person to die was 16 years old, Ahmad said.
The chief of Pakistan's powerful military, Gen. Raheel Sharif, canceled a planned trip to Sri Lanka because of the violence, a military spokesman said on Twitter.
Multiple groups claim involvement
In the immediate hours after the attack there was confusion about who was responsible.
First, Jundullah, a militant group that targets Shiites, claimed responsibility through a spokesman, Ahmed Marwat. He said four of the group's members took part in the attack, two fewer than the number given by police.
"We will continue such attacks," he warned, saying Pakistan's Shiites and the Ahmadi religious minority are the group's "main targets."
The main branch of the Pakistani Taliban led by Mullah Fazlullah also claimed it had cooperated with Jundullah in the attack.
Finally, the Islamic State in Khorasan, ISIS' affiliate in Afghanistan and Pakistan, claimed that it was responsible.
Don Rassler, a researcher at the Combating Terrorism Center at West Point who has written extensively on Pakistani militant groups, said it was not clear yet who was responsible.
"The multiple claims of responsibility from the Islamic State in Khorasan, the main wing of the Pakistani Taliban and Jundullah only reinforce the fractured, opportunistic and at times competitive nature of Pakistan's Sunni militant landscape. This episode illustrates that for many of these groups it is the perception of their involvement -- in attacks like the one that happened in Karachi today -- that often matters most," Rassler said.
ISIS links are murky
The relationship between Jundullah and ISIS remains unclear. Pakistani media reported that Jundullah had joined the ISIS fold late last year but Rassler said the only evidence of this was a posting on a top tier jihadi forum last November from a purported Jundullah member claiming the group had pledged allegiance to ISIS. ISIS has not yet publicly acknowledged the pledge.
Rassler said it would be unlikely for the main wing of the Pakistani Taliban to collaborate openly and directly with ISIS in launching an attack because of their public profession of loyalty to Mullah Omar rather than ISIS leader Abu Bakr al-Baghdadi.
Rassler said it is difficult to know how strong ISIS is in Pakistan now, but estimates its numbers as at most in the low hundreds. The group's numbers swelled when several Pakistani Taliban leaders defected to ISIS last year after losing out in a power struggle.
If the Islamic State in Khorasan was behind the attack, it would be the group's first significant attack in Pakistan, said Rassler, a move likely designed to boost its profile and stir sectarian tensions.
"I don't think it would necessarily be a game change," Rassler said. "Pakistan is a crowded marketplace when it comes to jihadi groups, which would limit their ability to attract more recruits with just one attack."
Shiites are regularly the victims of sectarian attacks in Sunni-majority Pakistan.
A bombing in January
at a Shiite mosque in the city of Shikarpur, which like Karachi is in Sindh province, killed scores of people. That attack was claimed by Jundallah.
An attack in February on a Shiite mosque in the northwestern city of Peshawar killed at least 19 people and injured dozens of others. The Pakistan Taliban claimed responsibility for those killings.
Members of the Ismaili sect are dotted throughout dozens of countries, primarily in South and Central Asia, Africa and the Middle East. Their leader is the Aga Khan, who they believe is a direct descendant of the Prophet Mohammed.
The Ismaili community in Pakistan is "mostly apolitical and keeps a low profile," said Yusuf.
The current Aga Khan, His Highness Prince Karim Aga Khan IV, issued a statement Wednesday from France expressing shock and sadness over the bus killings.
"This attack represents a senseless act of violence against a peaceful community," said the Aga Khan, who is a billionaire philanthropist as well as the Ismailis' spiritual leader. "My thoughts and prayers are with the victims and the families of those killed and wounded in the attack."