One-way quantum computation proceeds by sequentially measuring individual spins (qubits) in an entangled many-spin resource state. It remains a challenge, however, to efficiently produce such resource states. Is it possible to reduce the task of generating these states to simply cooling a quantum many-body system to its ground state? Cluster states, the canonical resource for one-way quantum computing, do not naturally occur as ground states of physical systems. This led to a significant effort to identify alternative resource states that appear as ground states in spin lattices. An appealing candidate is a valence-bond-solid state described by Affleck, Kennedy, Lieb, and Tasaki (AKLT). It is the unique, gapped ground state for a two-body Hamiltonian on a spin-1 chain, and can be used as a resource for one-way quantum computing. Here, we experimentally generate a photonic AKLT state and use it to implement single-qubit quantum logic gates.