A novel experiment, aiming at demonstrating the feasibility of hypernuclear spectroscopy with heavy-ion beams, was conducted. Using the invariant mass method, the spectroscopy of hypernuclear products of 6 Li projectiles on a carbon target at 2 A GeV was performed. Signals of the Λ-hyperon and 3 Λ H and 4 Λ H hypernuclei were observed for final states of p+π − , 3 He+π − and 4 He+π − , respectively, with significance values of 6.7, 4.7 and 4.9σ. By analyzing the proper decay time from secondary vertex distribution with the unbinned maximum likelihood fitting method, their lifetime values were deduced to be 262 +56 −43 ± 45 ps for Λ, 183 +42 −32 ± 37 ps for 3 Λ H, and 140 +48 −33 ± 35 ps for 4 Λ H.