Roots are the primary site of interaction between plants and microorganisms. To meet food demands in changing climates, improved yields and stress resistance are increasingly important, stimulating efforts to identify factors that affect plant productivity. The role of bacterial endophytes that reside inside plants remains largely unexplored, because analysis of their specific functions is impeded by difficulties in cultivating most prokaryotes. Here, we present the first metagenomic approach to analyze an endophytic bacterial community resident inside roots of rice, one of the most important staple foods. Metagenome sequences were obtained from endophyte cells extracted from roots of field-grown plants. Putative functions were deduced from protein domains or similarity analyses of protein-encoding gene fragments, and allowed insights into the capacities of endophyte cells. This allowed us to predict traits and metabolic processes important for the endophytic lifestyle, suggesting that the endorhizosphere is an exclusive microhabitat requiring numerous adaptations. Prominent features included flagella, plant-polymer-degrading enzymes, protein secretion systems, iron acquisition and storage, quorum sensing, and detoxification of reactive oxygen species. Surprisingly, endophytes might be involved in the entire nitrogen cycle, as protein domains involved in N2-fixation, denitrification, and nitrification were detected and selected genes expressed. Our data suggest a high potential of the endophyte community for plant-growth promotion, improvement of plant stress resistance, biocontrol against pathogens, and bioremediation, regardless of their culturability.