In most cases, military coups correspond to the sample of the above mentioned first or second type. This is only natural as the army’s officer corps represents the core of the bourgeois state apparatus. Hence, military coups usually represent the attempt of the ruling class (or sectors of it) to settle conflicts between them and/or to suppress the toiling masses by force.
However, as we have already explained in the past, there can be exceptional cases where a coup has a rather different character. Such a case belong to that type of coups which we would call the third category: military coups which are part of a broader process of popular uprising against a reactionary regime. 
Marxists, of course, do not advocate a coup as the way forward for the liberation of the working class and the oppressed. The method of the class struggle focuses on the organization of the working class in the struggle for the overthrow of the ruling class via mass mobilizations – demonstrations, strikes, general strikes, and armed insurrection.
However, there can be circumstances where the social contradictions between the ruling class and the middle class and the popular masses lead to sharp conflicts inside the army’s officer corps. In such cases it can happen, that lower-ranking officers – coming usually from the middle class – rebel against the ruling regime.
One example for such a “progressive” coup has been an uprising of left-wing officers in summer 1932 which led to the short-lived “Socialist Republic of Chile”.  While the Stalinists denounced this uprising as “a fascist coup under a socialist mask”, the Trotskyists lend critical support to it. 
In our essay on the Egypt coup in 2013 and the treacherous pro-Army “socialists” supporting it, we named several other cases of such a kind of military coup. We referred to the rebellion of the Free Officers movements in Egypt (1952) or Iraq (1958) against the monarchies which were lackeys of the imperialist Great Powers. Another example is the so-called Carnation Revolution on 25th April 1974 in Portugal when low-ranking officers organized in the Movimento das Forças Armadas overthrew the reactionary Estado Novo dictatorship. The downfall of this regime which ruled Portugal since 1926 opened a revolutionary period in which the masses played a highly active role and only failed in a successful socialist revolution because of the betrayal of social democracy and the Stalinist PCP.
More recent examples are the successful overthrow of the reactionary regime in Burkina Faso in 1983 by a military uprising led by “Africa’s Che Guevara”, Thomas Sankara. Another example is the failed coup d’état (“Operation Zamora“) of Hugo Chávez and his MBR-200 movement in Venezuela in February 1992.
While Marxists would not participate in such coups as it contradicts our method of class struggle, they certainly would have a different approach to such coups than they have to the coups of the first and second type.
In opposite of the former cases, revolutionaries would not call the working class to mobilize against the coup. They would rather advocate using the coup in order to mobilize against the old, reactionary regime. They would call for mass mobilizations to bring down the ruling elite and to fraternize with the soldiers who are conducting such a coup against the same enemy. In other words, they would join the struggle on the side of the rebellious soldiers but with their own methods of mass mobilizations and organizing of the workers and oppressed.
 See on this e.g. the sub-chapter „Can a Military Coup ever reflect an Advance of the Revolution?“ in: Michael Pröbsting: The Coup d’État in Egypt and the Bankruptcy of the Left’s “Army Socialism”, Chapter II. “The Marxist classics on reactionary coups d’états”, in: Revolutionary Communism No. 13 (September 2013), p. 25, https://www.thecommunists.net/theory/egypt-and-left-army-socialism/
 See on this e.g. Arno Münster: Chile – friedlicher Weg? Rotbuch Verlag, Berlin 1975, pp. 48-51
 See on this e.g. Leo Trotzki: Schriften 3.3., Neuer ISP-Verlag, Köln 2001, p. 425