As captain of the frigate "Gripen" 1784-85 he carried out an expedition to the Mediterranean and a mission to the Sultan of Morocco. During the outbreak of the Russo-Swedish War in 1788, he received the command of the Galley Squadron's third division. During the Battle of Svensksund on 24 August 1789 he defended the passage aboard the hemmema "Oden", until the rest of the fleet managed to escape, when he, after a ten-hour incessant cannonade at last, had to surrender and was taken as a prisoner to Russia. There he was nursed by Catherine the Great's chief physician. After having returned to Sweden, Rosenstein was promoted to colonel in the Swedish Army in 1790 and with the frigate "Bellona" he carried out a new mission to Morocco in 1791. He was appointed acting commander of the Stockholm Squadron in 1794 and was promoted to rear admiral in 1797.