Mårtensson was born in Kristianstad, Sweden. He became a lieutenant in 1983 and captain in 1984. Mårtensson served as company commander in the Wendes Artillery Regiment in 1989 and attended the Junior Staff Course at the Swedish Armed Forces Staff College from 1989 to 1990. He was promoted to major in 1990 and then attended the Advanced Staff Course at the Swedish Armed Forces Staff College from 1991 to 1993. Mårtensson served as a General Staff Aspirant at the Defence Materiel Administration in 1993 and at the Army Command at the Swedish Armed Forces Headquarters in 1994. He then served as Planning Officer at the Army Command at the Swedish Armed Forces Headquarters in 1995 and as ADC to the Chief of Army Staff two years later. Mårtensson was promoted to lieutenant colonel in 1998 and attended the Joint Command and Staff College in London from 1998 to 1999. In 1999, he returned to his old unit, Wendes Artillery Regiment, as battalion commander and head of training. The year after, Mårtensson was appointed chief of the Unit Section in the General Training and Management Directorate at the Swedish Armed Forces Headquarters in Stockholm. In 2002, he was promoted to colonel and appointed commanding officer of the Artillery Regiment, School of Artillery and the Kristinehamn Garrison. Mårtensson stayed in this position for four years, during this time responsible for relocation of the regiment to Boden in 2005. In 2006 he was appointed commanding officer of the Land Warfare Centre in Skövde and Kvarn. He was appointed chief of Chief of Training and Procurement and promoted to brigadier general in 2007 and appointed Chief of Training and Development and promoted to major general in January 2009 when he and lieutenant general Anders Silwer changed positions. He was promoted to lieutenant general later that same year. In 2014, Mårtensson was appointed Chief of Operations and head of the Joint Forces Command, a position he held for two years. He was from 2009 to 2016 when he retired from the Swedish Armed Forces, a member of the Swedish Armed Forces Command Group. Mårtensson was then appointed Director General of the Defence Material Administration from 1 February 2016 and National Armament Director.