A principal bundle which admits a flat connection is referred to as flat and not necessarily trivial as can be seen in the example of the principal Z2 bundle Sn --> Pn, even if the example is rather trivial. We will show that in the case when the structure group is compact and connected the flat principal bundle and its adjoint bundle have the same de Rham cohomology as the trivial bundle.