Competing endogenous RNA (ceRNA) has emerged as an important post-transcriptional mechanism that simultaneously alters expressions of thousands genes in cancers. However, only a few ceRNA genes have been studied for their functions to date. To understand the major biological functions of thousands ceRNA genes as a whole, we designed Model-based Analysis of Competing-endogenous Pathways (MACPath) to infer pathways co-regulated through ceRNA mechanism (cePathways). Our analysis on breast tumors suggested that NGF (nerve growth factor)-induced tumor cell proliferation might be associated with tumor-related growth factor pathways through ceRNA. MACPath also identified indirect cePathways, whose ceRNA relationship is mediated by mediating ceRNAs. Finally, MACPath identified mediating ceRNAs that connect the indirect cePathways based on efficient integer linear programming technique. Mediating ceRNAs are unexpectedly enriched in tumor suppressor genes, whose down-regulation is suspected to disrupt indirect cePathways, such as between DNA replication and WNT signaling pathways. Altogether, MACPath is the first computational method to comprehensively understand functions of thousands ceRNA genes, both direct and indirect, at the pathway level.