We report for the first time the A1 and C codoping effect on the structures and superconductivity in MgB2. It was found that both the lattice parameters and the Tc decreased monotonically with increasing doping level of both A1 and C. The Tc dropped to 27.5 and 7 K for ÃÂÃÂ=0.2 and for ÃÂÃÂ =0.4, respectively. The reduction of TcÃÂÃÂ¬ for the codoping was found to be quicker then for individual A1 doping and slower than for individual C doping at the same doping levels. First-principles calculations indicated that the observed decrease in Tc for the codoped MgB2 can be understood in terms of a band filling effect due to the electron doping by both A1 and C. However, it is suggested that other factors may also play a role in the Tc reduction in the real Mg1-ÃÂÃÂ A1 ÃÂÃÂ B2-ÃÂÃÂ CÃÂÃÂ samples. Furthermore, the A1 and C codoping also reduces Jc and weakens flux pinning in MgB2.