Petar, whose father Ivica (pronounced [ǐʋit͡sä]) played for Dinamo's cadets, started off by playing in Dinamo's Hitrec-Kacian football academy. With Dinamo's pioneers he won three titles from 2008-09 to 2010-11 and with the cadets he won one title in 2012-13. Besides these titles he won the 2014 Mladen Ramljak Tournament with the cadets scoring a total of five goals, won the silver medal with the cadets on the 2014 Zayed International Football Cup and, with the juniors, won the 2014 Tournament of Turopolje. He went with Luka Capan on football trials with the seniors and made his debut for the seniors, donning the number 15, in a 3-1 win against NK Istra 1961 on 6 February 2014 playing the first half. However, Mamić and Capan were put on the B squad after the 2014 summer transfer window to serve as backup for the seniors.
Mamić debuted for the B team, this time wearing the number 26, in a friendly 4-0 win over NK Hrvatski Dragovoljac on 20 July. Mamić proceeded to play seven more friendlies earning a red card in the sixth game before suffering a concussion in the seventh game after a strong blow to the head only minutes after having scored his first goal for the B team. Following his injury, he was replaced by Nicolas Taravel but resumed training after only a week making a comeback, and also debut in the league, five days later, on 9 September, in a 5-2 win over NK Moslavina. Mamić, after having played one more league game, was called in for the U-19 national team to participate in the 2015 UEFA European Under-19 Championship qualification and missed out on three league games before returning, on 14 October, in a friendly against NK Libertas. Mamić returned to the league on 18 October, playing full-time and earning a yellow card in a tie with NK Vrbovec. Mamić played five more games in the fall season, earning two more yellow cards and scoring his first ever league goal from a penalty, on 29 November, in a 3-1 win over NK Rijeka II.
Mamić was speculated to be kept in the B team so as to maintain Dinamo B's domination in the league in hopes of moving up to Druga HNL, especially after Mario Musa was called back to Dinamo's seniors. However, on 8 January 2015, Lokomotiva announced that Mamić had been loaned out to them for the rest of the season, along with Franko Andrijašević and Dino Perić.
Mamić debuted for NK Lokomotiva on 18 January 2015, wearing the number 3, in a friendly 3-0 win over NK Vrapče. Mamić went to Rovinj on trials with the team and played all of the matches of the 2015 Arena Kup. Mamić debuted for the team in the league on 7 February in a 1-2 loss against GNK Dinamo Zagreb. Three weeks later he was a last-minute substitute and was substituted in on two more games before being given another chance to play in the starting roster again in a 1-2 loss against Dinamo. Mamić was once more a substitute and finally got to play three full games in a row at the end of the season, even earning two yellow cards. Mamić also played both quarter-final games against NK Rijeka in the 2014–15 Croatian Football Cup and earned a yellow card in the first game.
Lokomotiva had qualified for the 2015–16 UEFA Europa League so Mamić went with the team on trials in Slovenia and debuted in the Europa League on 9 July in the second leg of the First round in a 2-2 draw against Welsh side Airbus UK Broughton F.C. He remained on the bench in the Second round against P.A.O.K. with Lokomotiva eventually being expelled with a 3-7 aggregate score. Mamić was benched for the first three games of the 2015-16 season before being transferred back to Dinamo Zagreb 2 to enable Dinamo to loan out Borna Barišić to Lokomotiva seeing as they had already loaned out six players to them.
Having left NK Lokomotiva, Mamić returned in the second round of the 2015–16 Croatian Second Football League on 22 August in a 2-0 loss against NK Šibenik. He played four more games before scoring an own goal in a 0-2 loss against NK Rudeš. He did, however, make up for it after two games by scoring his first goal of the season, as well as the equalizer in a 2-1 turnover victory over NK Šibenik. He played two further games and a game for the first team in the second round of the 2015-16 Croatian Football Cup against NK Mladost Ždralovi before being injured, only five minutes after scoring a goal, in a friendly match against NK Jedinstvo Sveti Križ Začretje forcing him to miss out on the next league game. He returned on 13 November against HNK Gorica but remained on the bench. Mamić finished the first half of the season playing full-time in both remaining games. He played seven warm up games before the start of the second half of the season, including warm ups in Umag. Mamić continued the season in style scoring the first goal from a penalty in a 3-2 turnover victory against HNK Segesta and giving an assist to Karlo Majić for the equalizer. He scored the last goal in a 3-0 victory over NK Rudeš in the very next game from an assist from Bojan Knežević as well as the last goal in a 2-0 victory two games later against HNK Segesta after an assist by Tibor Halilović. Mamić played the next four matches before playing an excellent match, giving both assists in a 2-1 victory over NK Sesvete. He played another two games but was forced to miss out on the following match against HNK Gorica due to accumulated yellow cards. He finished the season playing both remaining games.
After the season ended Mamić played in all of the B team's five preseason warm-up games and started the following season playing the second half of the first game against NK Solin. He was then benched for the following two games in light of transfer negotiations with Cagliari Calcio but returned in the following match against NK Novigrad after the 2016 summer transfer window had closed. He went on to play the next three league matches but then missed the next game after having being submitted to the first team's final roster for the 2016-17 UEFA Champions League. Ultimately he was not chosen for the game squad and so returned in the next league match but was again benched in the next game when, due to many player's absences, six first team players came on. He played the next game and then scored a last-minute goal in a 3-1 victory over NK Solin with Dinamo one player down.
Mamić debuted for the Croatian under-14 team on 26 May 2010 playing a friendly against Bavaria. Later that year he joined the under-15 team and played six friendlies throughout the season. After a short hiatus he joined the national under-16 side eventually competing in eight friendlies.
Mamić debuted for the Croatian under-17 team on 1 August 2012 in a friendly against the Czech Republic scoring his first ever international goal only two days later in a friendly against Serbia. Mamić was selected for the 2013 UEFA European Under-17 Championship qualification team. He played a good first game against Israel receiving a yellow card only to score his first competitive goal in the second match against Kazakhstan. After qualifying for the Elite round Mamić scored the first goal against Spain after a corner kick in the 45' minute eventually leading to Croatia's victory. Petar played the rest of the qualifications qualifying for the European Championship and after two goalless games received a red card in the final game against Ukraine. In October Mamić, having missed the first game of the World Cup, played a very good game against Panama and played a somewhat weaker game against Uzbekistan eventually being replaced by Ivan Fiolić.
Besides playing three friendlies with the Croatian under-18 team Mamić was called in for the Croatia national under-19 football team and debuted on 12 August 2013 in a friendly against Azerbaijan playing 79 minutes before being replaced by Luka Capan. Mamić was also called in for the 2015 UEFA European Under-19 Championship qualification playing full-time in all three games earning a yellow card in the third game against Turkey and qualifying for the Elite Round. Mamić played the first and third game in the Elite Round with both ending in draws but ultimately failed to qualify for the 2015 UEFA European Under-19 Championship.Dinamo Zagreb
Prva HNL (1): 2013–14
Petar, just like fellow players Niko Kranjčar and Andrej Kramarić, graduated, in 2014, from the prestigious XV Gymnasium in Zagreb.