We develop a general group-based continuous-time Markov epidemic model (GgroupEM) framework for any compartmental epidemic model (e.g., susceptible-infected-susceptible, susceptible-infected-recovered, susceptible-exposed-infected-recovered). Here, a group consists of a collection of individual nodes of a network. This model can be used to understand the critical dynamic characteristics of a stochastic epidemic spreading over large complex networks while being informative about the state of groups.