We show that the Wannier obstruction and the fragile topology of the nearly flat bands in twisted bilayer graphene at magic angle are manifestations of the nontrivial topology of two-dimensional real wave functions characterized by the Euler class. To prove this, we examine the generic band topology of two dimensional real fermions in systems with space-time inversion IST symmetry. The Euler class is an integer topological invariant classifying real two band systems. We show that a two-band system with a nonzero Euler class cannot have an IST -symmetric Wannier representation. Moreover, a two-band system with the Euler class e2 has band crossing points whose total winding number is equal to −2e2. Thus the conventional Nielsen-Ninomiya theorem fails in systems with a nonzero Euler class. We propose that the topological phase transition between two insulators carrying distinct Euler classes can be described in terms of the pair creation and annihilation of vortices accompanied by winding number changes across Dirac strings. When the number of bands is bigger than two, there is a Z2 topological invariant classifying the band topology, that is, the second Stiefel Whitney class (w2). Two bands with an even (odd) Euler class turn into a system with w2 = 0 (w2 = 1) when additional trivial bands are added. Although the nontrivial second Stiefel-Whitney class remains robust against adding trivial bands, it does not impose a Wannier obstruction when the number of bands is bigger than two. However, when the resulting multi-band system with the nontrivial second Stiefel-Whitney class is supplemented by additional chiral symmetry, a nontrivial second-order topology and the associated corner charges are guaranteed. * These authors contributed equally to this work. † bjyang@snu.ac.kr the U v (1) valley and the space-time inversion C 2z T symmetries, where C 2z denotes a two-fold rotation about the z-axis and T is time-reversal symmetry [29,30]. In the presence of U v (1) and C 2z T symmetries, the four nearly flat bands are decoupled into two independent valley-filtered two-band systems, and each two-band system possesses Dirac points at K and K . The fact that both the valley charge conservation and C 2z T symmetries are not the exact symmetry of the TBG indicates that the symmetry of the low energy physics is larger than the exact lattice symmetry [29].Interestingly, by putting together all the emergent symmetries including U v (1) and C 2z T symmetries, Po et al. have found an obstruction to constructing well-localized Wannier functions describing the four nearly flat bands in TBG [29,30]. Moreover, it has been shown that the obstruction originates from the fact that the two Dirac points in each valleyfiltered two-band system have the same winding number, which is generally not allowed in 2D periodic systems due to the Nielsen-Ninomiya theorem [41]. In addition, based on the observation that the winding number is defined only for a two-band model in each valley, it is conjectured that the Wannier obstruction is fragile [29,3...