Ultimate attribution error
The ultimate attribution error is a type of attribution error which describes how attributions of outgroup behavior are more negative than ingroup behavior. As a cognitive bias, the error results in negative outgroup behavior being more likely to be attributed to factors internal and specific to the actor, such as personality, and the attribution of negative ingroup behavior to external factors such as luck or circumstance. The bias reinforces negative stereotypes and prejudice about the outgroup and favouritism of the ingroup through positive stereotypes. The theory also extends to the bias that positive acts performed by ingroup members are more likely a result of their personality. Four categories have been identified that describe the negative attribution of positive outgroup behaviour. First, that the outgroup member is an exception to a general rule; second, that the member was lucky or had specific advantages; third, that the member was highly motivated; and lastly that the behaviour as attributable to situational causes. The concept and term originates in an article by Thomas F. Pettigrew in 1979 as an extension of the fundamental attribution error which was identified in 1958. Since its publication, which at the time lacked a strong empirical basis, there has been some support for the theory. The specific categorisation originally proposed had only some empirical support for broader categories of motivational and cognitive attribution. The bias is related to intergroup attribution bias. Original theory

In the case of negative attribution of outgroup member's positive behaviours, four categories were proposed. The four categories each correspond to combinations of two factors: perceived degree of controllability of act (low vs high) and perceived locus of control of act (internal vs external). Exceptional case

The "exceptional case" explanation is created at the intersection of low controllability of act and internal locus of control. Using this mode of reasoning, an individual excludes the particular outgroup member from the outgroup. That is, they individuate the outgroup member, disassociating them from the group. This view allows for the maintenance of prejudiced beliefs through categorizing the "good" member as an exceptional case, while the other members of their group are still seen as "bad". Luck or special advantage

The "luck or special advantage" explanation is created at the intersection of low-perceived controllability of act and external locus of control. This reasoning suggests that the outgroup member's positive behavior is not rooted in their skill, ability, or hard work. Rather, their positive outcome is beyond their immediate control and therefore of little significance. "Special advantage" extends this by suggesting that their group affiliation offers some advantage, and therefore the positive outcome is again of little significance. Highly motivated

The "highly motivated" explanation is created at the intersection of high-perceived controllability of act and internal locus of control. Similar to the exceptional case, the highly motivated explanation individuates the outgroup member and dissociates them from their group. The outgroup member's positive behavior is rooted in their drive to be seen as anti-stereotypic, an external force. Thus, they are not seen as intrinsically exceptional, but externally motivated, and, without this motivation, they would not be able to achieve success. That is, an outgroup member's positive behavior is evidence of their response to external pressures of their interaction with ingroup other. Therefore, without an external source of motivation, the outgroup member is just like any other low-achieving, negative-behavior outgroup member. Similar to the "exceptional case" explanation, this explanation allows for the maintenance of prejudiced beliefs. That is, the highly motivated outgroup member is seen as hard working, so there must be something wrong with the rest of them. Situational

The "situational" explanation is created at the intersection of high-perceived controllability of act and external control of the act. An outgroup member's positive outcome is not rooted in their effort or ability, but a result of external situational factors that are, at least in some part, influenced by others. Therefore, their positive behavior is not their own, and is of little consequence. History
Pettigrew originally published the concept using three prior studies for an empirical basis. One of these was a 1974 study which found results supporting the ultimate attribution error in the causal attributions between religious ingroup and outgroup members. In a 2x2 between-group design, Hindu or Muslim participants were asked to make casual attributions for undesirable acts performed by Hindus or Muslims. Hindus attributed external causes to undesirable acts committed by fellow Hindus, but an internal cause for undesirable acts committed by Muslims. Conversely, Muslims attributed external causes to undesirable acts committed by fellow Muslims, but an internal cause for undesirable acts committed by Hindus. While Pettigrew and many others to follow would focus on race, this study offered clear evidence that similar mechanisms are at play among religious groups. Another study that was drawn on for Pettigrew's original theory was a 1976 study of ethnocentric behavior. It found that white participants viewed black individuals as more violent than white individuals in an "ambiguous shove" situation, where a black or white person accidentally shoves a white person. In a 2x2 between-group design, white participants viewed a black or white individual (harm-doer) ambiguously shoving a black or white individual (victim). In general, when a black harm-doer shoved another person (whether they were black or white), their behavior was attributed their high dispositional levels of violence (internal). On the other hand, when a white harm-doer shoved another person (whether they were black or white), their behavior was generally attributed to external constraints. The results suggested that the white students participating in the experiment possessed a lower threshold for labeling a behavior as violent when the harm-doer is black (outgroup) than when the harm-doer is white (ingroup). In 1990, a meta-analysis of 19 ultimate attribution error studies offered limited support for Pettigrew's ultimate attribution error. Specifically, it found support for three aspects of the ultimate attribution error:
more internal attribution for positive acts, and less internal attribution for negative acts, by ingroup than outgroup members;
more attribution of outgroup members' failures to lack of ability, and more explaining away of outgroup members' successes;
a preference for ingroup-serving versus outgroup-serving attributions for group differences. See also

 Actor–observer asymmetry
 Cultural bias
 Dispositional attribution
 Group attribution error

References
 

Attitude attribution 
Group processes
Sociological terminology
Cognitive biases
Error
Causal fallacies
Prejudice and discrimination