A number of superconducting qubits, such as the transmon or the phase qubit, have an energy level structure with small anharmonicity. This allows for convenient access of higher excited states with similar frequencies. However, special care has to be taken to avoid unwanted higher-level populations when using short control pulses. Here we demonstrate the preparation of arbitrary three level superposition states using optimal control techniques in a transmon. Performing dispersive readout, we extract the populations of all three levels of the qutrit and study the coherence of its excited states. Finally we demonstrate full quantum state tomography of the prepared qutrit states and evaluate the fidelities of a set of states, finding on average 95%.