Costa was sent off in the first half of Atletico's 2-0 defeat to Barcelona on Saturday for directing a crude insult towards referee Gil Manzano. Manzano also reported that Costa had "grabbed" him by the arms during the incident.
The lengthy ban means Costa will not play again this season as Atletico have seven games left in La Liga, having been knocked out of the Champions League and Copa del Rey.
Atletico president Enrique Cerezo suggested on Thursday the club will appeal against the decision.
"It's bad news," Cerezo said on Thursday. "The natural thing is for us to appeal, to ask for leniency and see what happens.
"There are players who are very temperamental. Insults should never happen on the football field but there are times when they do happen."
According to the match report submitted by Manzano, Costa insulted his mother in a foul-mouthed outburst before "grabbing me by the arms to prevent me showing cards to numbers 24 and 2 respectively".
The RFEF ruled Costa should therefore be suspended for four matches for "clear insults and offensive expressions made by the player towards the referee" and another four, after "meeting the referee with mild violence, without aggressive spirit, but in a manner that is reflected in the act of grabbing".
The statement added: "Consequently, it is appropriate to sanction the player with a four-game suspension referring to article 94 (insults, verbal offenses and insulting attitudes) and four more referring to article 96 (light violence towards the officials), both from the Federation's Disciplinary Code."
Costa's dismissal in the 28th minute at Camp Nou meant Atletico had to play for more than an hour with 10 men in a match coach Diego Simeone had said they had to win to keep their title hopes alive.
Instead, defeat leaves them 11 points adrift of Barca at the top of the table.
Costa has endured a difficult season, having scored only five goals in all competitions and missed almost two months at the start of the year due to a foot injury.
Atletico signed Alvaro Morata on loan from Chelsea in January and the 26-year-old is now likely to be given an extended run in the starting line-up.
Costa is no stranger to controversy. He moved to Atletico after falling out with Chelsea coach Antonio Conte in 2017, a dispute that saw the forward relocate to Brazil and refuse to play for his club.
He was also twice handed three-match suspensions by the Football Association in England, for stamping on Liverpool's Emre Can in January 2015 and kicking Arsenal defender Gabriel Paulista nine months later.
After Atletico's loss to Barca, Simeone said: "I asked the referee and he told me Costa said something to him. Other players have said things and not been sent off but that does not justify what Costa did."