Solid MgB(2) has rather interesting and technologically important properties, such as a very high superconducting transition temperature. Focusing on this compound, we report the first nontrivial application of a novel density-functional-type theory for superconductors, recently proposed by the authors. Without invoking any adjustable parameters, we obtain the transition temperature, the gaps, and the specific heat of MgB(2) in very good agreement with experiment. Moreover, our calculations show how the Coulomb interaction acts differently on sigma and pi states, thereby stabilizing the observed superconducting phase.