content: <?xml version="1.0" encoding="UTF-8"?><edgarSubmission xmlns="http://www.sec.gov/edgar/ownership" xmlns:com="http://www.sec.gov/edgar/common">
    <headerData>
      <submissionType>144</submissionType>
      <filerInfo>
        <filer>
          <filerCredentials>
            <cik>0001490436</cik>
            <ccc>XXXXXXXX</ccc>
          </filerCredentials>
        </filer>
        <liveTestFlag>LIVE</liveTestFlag>
  
  
  
      </filerInfo>
    </headerData>
    <formData>
      <issuerInfo>
        <issuerCik>0001201792</issuerCik>
        <issuerName>AMERICAN PUBLIC EDUCATION INC</issuerName>
        <secFileNumber>001-33810</secFileNumber>
        <issuerAddress>
          <com:street1>111 W CONGRESS STREET</com:street1>
          <com:city>CHARLES TOWN</com:city>
          <com:stateOrCountry>WV</com:stateOrCountry>
          <com:zipCode>25414</com:zipCode>
        </issuerAddress>
        <issuerContactPhone>(304) 724-3700</issuerContactPhone>
        <nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>Beckett Thomas</nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>
        <relationshipsToIssuer>
          <relationshipToIssuer>Officer</relationshipToIssuer>
        </relationshipsToIssuer>
      </issuerInfo>
      <securitiesInformation>
        <securitiesClassTitle>Common</securitiesClassTitle>
        <brokerOrMarketmakerDetails>
          <name>Fidelity Brokerage Services LLC</name>
          <address>
            <com:street1>900 Salem Street</com:street1>
            <com:city>Smithfield</com:city>
            <com:stateOrCountry>RI</com:stateOrCountry>
            <com:zipCode>02917</com:zipCode>
          </address>
        </brokerOrMarketmakerDetails>
        <noOfUnitsSold>2900</noOfUnitsSold>
        <aggregateMarketValue>37366.50</aggregateMarketValue>
        <noOfUnitsOutstanding>17505345</noOfUnitsOutstanding>
        <approxSaleDate>03/08/2024</approxSaleDate>
        <securitiesExchangeName>NASDAQ</securitiesExchangeName>
      </securitiesInformation>
      <securitiesToBeSold>
        <securitiesClassTitle>Common</securitiesClassTitle>
        <acquiredDate>01/22/2024</acquiredDate>
        <natureOfAcquisitionTransaction>Restricted Stock Vesting</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>N</isGiftTransaction>
        <amountOfSecuritiesAcquired>1202</amountOfSecuritiesAcquired>
        <paymentDate>01/22/2024</paymentDate>
        <natureOfPayment>Compensation</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>Common</securitiesClassTitle>
        <acquiredDate>01/31/2024</acquiredDate>
        <natureOfAcquisitionTransaction>Restricted Stock Vesting</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>Issuer</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>N</isGiftTransaction>
        <amountOfSecuritiesAcquired>1698</amountOfSecuritiesAcquired>
        <paymentDate>01/31/2024</paymentDate>
        <natureOfPayment>Compensation</natureOfPayment>
      </securitiesToBeSold>
      <nothingToReportFlagOnSecuritiesSoldInPast3Months>Y</nothingToReportFlagOnSecuritiesSoldInPast3Months>
      <noticeSignature>
        <noticeDate>03/08/2024</noticeDate>
        <signature>/s/ Jared Cook, as a duly authorized representative of Fidelity Brokerage Services LLC, as attorney-in-fact for Thomas A. Beckett</signature>
      </noticeSignature>
    </formData>
  </edgarSubmission>
metadata_documents: [{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 3386}]
text: 144
  0001490436
  XXXXXXXX
  LIVE
  0001201792
  AMERICAN PUBLIC EDUCATION INC
  001-33810
  111 W CONGRESS STREET
  CHARLES TOWN
  WV
  25414
  (304) 724-3700
  Beckett Thomas
  Officer
  Common
  Fidelity Brokerage Services LLC
  900 Salem Street
  Smithfield
  RI
  02917
  2900
  37366.50
  17505345
  03/08/2024
  NASDAQ
  Common
  01/22/2024
  Restricted Stock Vesting
  Issuer
  N
  1202
  01/22/2024
  Compensation
  Common
  01/31/2024
  Restricted Stock Vesting
  Issuer
  N
  1698
  01/31/2024
  Compensation
  Y
  03/08/2024
  /s/ Jared Cook, as a duly authorized representative of Fidelity Brokerage Services LLC, as attorney-in-fact for Thomas A. Beckett