LISBON (Reuters) - Portugal's prime minister has told the European Commission that imposing sanctions on the country for budget deficit overshoots would be unfair, counterproductive and would not be understood by the Portuguese people after austerity under a bailout.

The European Commission began formal disciplinary procedures against Spain and Portugal on Thursday for excessive deficits in 2014 and 2015. The Council of EU finance ministers will decide on the Commission's recommendation on July 12.

In a letter sent to European Commission head Jean-Claude Juncker earlier this week, Prime Minister Antonio Costa argued that sanctions should not be applied automatically and the country's efforts since the overshoots in 2014 and 2015 should be considered.

"It would be unfair to punish a (EU) member state that is on the right path to correct its excessive deficit and just when it is about to achieve it," Costa wrote in the letter, a copy of which was sent to journalists on Thursday.

Costa said in the letter that sanctions "would not be understood by the Portuguese people, who have gone through a harsh economic recession and suffered 'austerity' measures, and would thus risk fostering an anti-European mood."

Costa also said in the letter that Britain's referendum to leave the EU "deserves an enhanced political consideration of the effects that such a decision could have."

(Reporting By Sergio Goncalves and Axel Bugge, editing by Andrei Khalip)