TOKYO — Japan’s space agency said a rocket carrying eight satellites failed just after liftoff Wednesday and had to be aborted by a self-destruction command, in the country’s first failed rocket launch in nearly 20 years.

The Epsilon-6 rocket was not in the right position to orbit around the Earth and its flight had to be aborted less than seven minutes after takeoff from the Uchinoura Space Center in the southern Japanese prefecture of Kagoshima, Japan Aerospace Exploration Agency President Hiroshi Yamakawa told an online news conference.

“We deeply apologize for our failure to live up to the expectations” of local officials and those who were involved in the development of the satellites, Yamakawa said, pledging to assist in the investigation into the cause of the failure.

JAXA officials said the agency sent a self-destruction signal after deciding the rocket was not able to fly safely and enter a planned orbit. JAXA said the rocket and payloads were believed to have fallen into the sea east of the Philippines.

The cause of the failure was still being investigated, the agency said.

The Epsilon rocket was carrying eight payloads, including two developed by a private company based in Fukuoka, another southern prefecture. It was the first time an Epsilon rocket carried commercially developed payloads.

Yasuhiro Uno, who directed the Epsilon-6 launch, acknowledged that the failure could affect Epsilon’s possible launch business in the future. A commercial launch under an upgraded version, Epsilon-S, by IHI Aerospace, a Japanese company, is being planned for a Vietnamese satellite next year.

“Our first and foremost mission is to investigate the cause and firmly take measures,” Uno said.

The 26-meter (85-foot) -long, 95.6-ton and solid-fuel Epsilon-6 rocket is the final version before JAXA plans to develop another variation, Epsilon-S. After five upgrades since the early 2010s, the Epsilon-6 is designed for a compact launch as JAXA aims to develop a commercial satellite launch business.

Wednesday’s failure ended success records for the Epsilon series since its first launch of the original version in 2013. It was also a first for JAXA since its H2A rocket failed in 2003.

The launch, originally scheduled for last Friday, had been delayed due to the location of a positioning satellite in space.