Abstract: The space of surface group representations is the space of all homomorphisms from the fundamental group of a surface to a Lie group G. In this talk, I will discuss the connected components of such a space when G is compact connected, and the surface is compact, connected, orientable or nonorientable, with or without boundaries. I will also interpret our results in terms of moduli space of flat bundles over compact surfaces. This is joint work with C.-C. Melissa Liu.